June 2002
Beginner to intermediate
640 pages
14h 24m
English
In interactive mode, you work with Python one instruction at a time. When it's set up as a standalone program (i.e., not needing user interaction), Python performs any number of consecutive tasks. Just turn it on, and it does all the rest. To use Python this way, you first have to write a program and then save it as a text file.
Enter the following at your console and save it as campPython.py.
print "hello mother" print "hello father" print "greetings from camp Python"
Go to the command prompt and enter Jython campPython.py.
C:\book\chap1>jython campPython.py
The output is
hello mother hello father greetings from camp Python
Essentially, you've created a module called campPython.py, and the text you typed in is ...
Read now
Unlock full access