[Tutor] Actually using programs

Paul Sidorsky paulsid@shaw.ca
Sat, 06 Apr 2002 00:12:52 -0700


Galen Senogles wrote:

>         Hello, I have a very easy question to solve,
> that I just cant quite find in the tutors.  Basically
> I just want to know how to actually apply whatever
> programs to your computer.  Is there a way to actually
> apply them?  Or are the programs just only to be run
> in the python program that recieves the input from the
> user and processes it, i know that is still very
> usefull but I just want to know how to actually use
> the programs...if I'm still to vague just let my know
> and I'll try to explain more.

This was a bit vague, but I think I understand.  If not, please ignore. 
:-)

Generally Python programs always run in the interpreter (python.exe
under Windows, just python in Unix environments).  Being an interpreted
language this is rather unavoidable.

Assuming you're under Windows (since Unix people are generally more
familiar with the concept that Python uses) you should be able to put
your program into one or more .py files and double-click the main .py
file to start it.  (If it's something you will use regularly, you can
put a shortcut on your desktop like any other program.)  The Python
interpreter will startup and begin to execute your program
automatically, and will terminate when your program finishes.

(This assumes nothing is strange about your Python installation, which
is not always the case - for example, double-clicking .py files doesn't
work for me.  It might be because I had a 2.2 alpha version installed at
one point but have since uninstalled it and gone back to 2.1.)

If that's not good enough, i.e. if you really want to make your programs
independent, then you'll have to check out py2exe which will let you put
your Python program its own .exe file, again for Windows only.

BTW if you're familiar with QuickBASIC or older Visual Basic, just think
of python.exe as BRUN45.EXE or VBRUNxxx.DLL.

-- 
======================================================================
Paul Sidorsky                                          Calgary, Canada
paulsid@shaw.ca                        http://members.shaw.ca/paulsid/