Installing Python 3 on Windows XP.
This tutorial is about installing Python 3 on Windows XP (32-bit). The tutorial uses Python 3.4.4 that I downloaded from the Python website (direct link). No idea if this is the most recent version of Python that supports Windows XP. If you find the 3.4 version too old, you can try some newer release; if you want to be sure that your installation succeeds, you should use the one used in the tutorial.
The Python download file is a Windows installer (MSI). You may install it for all users, or only for yourself. The default installation directory is C:\Python34. As mostly when a program wants to install directly beneath the root of the C: drive, I changed the directory to C:\Programs\Python34. The screenshot below shows how I chose to install the entire feature onto the local hard drive.
Note that, by default, the setup program also installs pip 7.1.2 and setuptools 18.2. Also, python.exe is added to the PATH.
To start the Python 3 interpreter, open Command Prompt and enter python (as python.exe has been added to the PATH, you can launch it from any directory, so normally you would do it from the directory containing your source file). You can enter an interactive help shell by entering help() in the interpreter shell (to return to the interpreter shell, type quit). To exit Python (and return to the Windows command line), enter quit().
To test our Python installation, lets create a one-line "Hello World" program, using the following code, and saving the script as hello.py.
print("Hello World!")
To run the program, cd to the directory containing the Python source code and run the command
python hello.py
The screenshot shows the program output.
The Python installation includes a graphical shell (simple IDE) called IDLE, that you can launch from the Windows Start menu. When I launched it, I got the error message shown on the screenshot below.
You will (very probably) not have to deal with this issue. In fact, the reason for the connection failure on my system was due to Outpost Firewall, that by default blocks all such connections. Creating some "allow" rules solved the problem...
The screenshot on the left shows how I opened the file hello.py in IDLE. The source will be displayed in a new (opening) IDLE window, where we can use the menu command Run > Run Module (shortcut F5) to execute the script (screenshot on the right).
The execution of the program proceeds in the first IDLE shell (or in a new one, if you open one). The screenshot shows the script output in the IDLE window.
Note: It should be possible to run Python scripts on IIS. However, I've not (yet) figured out how to use CGI on IIS 5.1 (for PHP and Perl, I use ISAPI). Another possibility could be to use FastCGI that is available for IIS 5.1, I think; I did not (yet) try...
If you like this page, please, support me and this website by signing my guestbook.