The following links may be helpful if you are studying Python programming:
python Game.py
which executes (or interprets) the Python program that is stored in
file Game.py. (I use the word "interpret" when I'm writing about
Python programs because Python programs are scripts that are
not compiled in the traditional way. When a Python interpreter executes
a program, the compilation and execution activities are carried out as a
single process.)
If you are usign a Windows computer, you probably need to install the
necessary Python tools. To make the installation, you should go to
www.python.org and download a free
installation file named python-2.4.3.msi. (The numbers in the file
name may be larger.) By executing this
file on your (Windows) computer, you can install the Python compiler and
documentation related to Python. When I installed the Python compiler,
I installed it to folder (directory) D:\Python24. After this I could
run the Python program Game.py in the following way in a command
prompt window:
D:\>cd pythonfiles2
D:\pythonfiles2>\Python24\python Game.py
This program is a computer game.
Please, type in an integer : 1234
You typed in 1234.
My number is 1235.
Sorry, you lost. I won. The game is over.
D:\pythonfiles2>
In the above case Game.py was in the folder D:\pythonfiles2. This may not the only way to run Python programs in Windows. Please, explore the tools that are installed when above-mentioned .msi file is executed, and you'll probably find easier ways to execute Python programs. It is also possible to execute a .py file by clicking on the file's icon but this usually terminates the program so quickly that you cannot see what it prints.
You can edit Python programs with the Notepad2 editor in Windows. The editor is able to highlight the Python syntax with several colors. Instructions for downloading and installing the Notepad2 editor are provided here.
www.python.org provides a lot of documentation related to Python. Some of these documents are installed to your Windows computer when you install the compiler.
If you are using Linux, you probably need to install an
additional software package to run PyQt.
In Windows, you first need the basic Python installation.
Then you need a corresponding binary for PyQt from
http://www.riverbankcomputing.co.uk/software/pyqt/download
After this you can run PyQt applications simply by commanding
When you execute the .exe file, it installs PyQt to the
same folder in which the basic Python was installed.
in the following way:
\Python26\python HelloQt.py
The pictures below are obtained from a fan site
of a British comedy group named Monty Python's Flying Circus.
The "father" of the Python programming language is a Dutch man named
Guido van Rossum, and he is a great fan of the mentioned comedy group.
He named his programming language after his favourite comedians.
Text copyright © Kari Laitinen
Last modification of this page: 2010-09-09
 
 
HOME
ALL
GUI
IC8
Java
C++
C#
Personal