February 2006
Intermediate to advanced
648 pages
14h 53m
English
In most cases, you’ll want programs to start the interpreter automatically, rather than first having to start the interpreter manually. On UNIX, this is done by giving the program execute permission and setting the first line of a program to something like this:
#!/usr/local/bin/python # Python code from this point on... import string print "Hello world" ...
On Windows, double-clicking a .py, .pyw, .wpy, .pyc, or .pyo file automatically launches the interpreter. Normally, programs run in a console window unless they’re renamed with a .pyw suffix (in which case the program runs silently). If it’s necessary to supply options to the interpreter, Python can also be started from a .bat file. For example, this .bat file ...