Install Python Application Component in EasyPHP

5/5 - (1 vote)

This article focuses on installing the Python application component in EasyPHP. This article also assumes you have an IDE installed and have completed the following articles:

and the following steps:

  • Started EasyPHP
  • Opened the Dashboard
  • Started the HTTP and Database servers

Download the Software

To download the Python application component, navigate to the web page for Python 2.7.11 for Devserver 17.0. The installation process should begin immediately. Once complete, move the executable file to the Desktop (or another selected location).

Start the Installation Process

Double-click the installation icon on the Desktop (or a different selected location) to start the installation process.

Allow App to Make Changes Dialog Box

The first dialog box you will see prompts you to allow this app to make changes to your device. Click the Yes button to confirm and move forward.

Select Setup Language Dialog Box

From the Select Setup Language dialog box, click the dropdown box and select the appropriate language. Then, click the OK button to confirm the selection and move forward.

Select Destination Location Dialog Box

From the Select Destination Location dialog box, you can either click the Browse button to select a new location or ignore and leave the default location as-is. Then, click the Next button to confirm the selection and move forward.

πŸ’‘Note: The default location, for this example, was left as-is.

Ready to Install Dialog Box

From the Ready to Install dialog box, click the Install button and wait for the process to complete the installation.

Installation Completion Dialog Box

Click the Finish button to complete the installation.

If successful, a ready-to-use Python application component is now available in the current EasyPHP Devserver.

You may need to restart the servers and restart EasyPHP to see the changes.


Configure Python in EasyPHP

Now we need to configure the Python application component. To do this, navigate to the EasyPHP Dashboard, and click the applications link on the top menubar.

This action forwards you to the EASYPHP DEVSERVER page.

Then, on the left-hand menu, click to select PYTHON. This action forwards you to the PYTHON page.

Select a Python Version

At this point, only one (1) version is currently available. Click the select button to confirm.

πŸ’‘Note: You could click the + button to add a different version. For this article, we will leave it as-is.

The toggle button now changes to active, and the version displays in a dark text color as shown below.

The Shebang Line

The #! Shebang Line shown below must be added to the top of each python script. This line lets EasyPHP know what interpreter to use while processing the file. In this case python.exe.

#!C:\Program Files (x86)\EasyPHP-Devserver-17\eds-binaries\python\default\python.exe

Sample Python File

After the installation process, EasyPHP added a sample Python file: python_example.py and placed it in the following folder:
C:\Program Files (x86)\EasyPHP-Devserver-17\eds-www

πŸ’‘Note: This location will vary if you installed EasyPHP somewhere else.


View Python Script in a Browser

To view python_example.php in a web browser tab, navigate to the home page of the EasyPHP Dashboard.

Click the Portable Directory icon to expand the contents.

This action displays the following (your contents may differ):

Click python_example.py to be forward to a new browser tab and display the HTML code!

View HTML Source Code

Let’s view the HTML source code from the HTML web page above and the python_example.py file.

Right-mouse-click over any white area on the above HTML web page to display a pop-up. Then, click the View page source item, or CTRL+U.

This action opens a new browser tab and displays the HTML source code for the selected page.

Compare the Python file with the source code to figure out what is happening here.

🌟The Finxter Challenge
Modify the HTML code in python_example.py.
Reload/refresh the web page to view the changes. Good Luck!


Summary

This concludes our series on Installing and Configuring EasyPHP!


Programmer Humor

❓ Question: How did the programmer die in the shower? ☠️

❗ Answer: They read the shampoo bottle instructions:
Lather. Rinse. Repeat.