[Tutor] pyhton (fwd)
Fri, 28 Dec 2001 11:48:02 -0000
>> Python programs, we go from top-down, executing each statement
>> in turn. For example:
>> print 1
>> print 2
>> print 3
>> should print out:
> i tried that but i just sead
> >>>print 2
> >>>print 3
Thats coz you are using pythons interactive mode.
If you type your program into a file using notepad say,
or better still in IDLE use File|New menu item.
Then run that file using python from the DOS command line
(or using Ctrl-F5 in IDLE) it will act as Danny suggested.
use notepad to create a file called prints.py containing:
Now start an MS DOS window and at the C:\> prompt type:
C:\> python prints.py
You should then see
displayed as output.
OR in IDLE use File|Open to open a new window and
type in the same 3 lines. Use File|SaveAs... to save
the file as prints.py Now hit Ctrl-F5 and in the
original IDLE window you will see the output: