[Tutor] Trouble getting started (fwd)
Gregor Lingl
glingl@aon.at
Mon, 12 Aug 2002 17:20:07 +0200
>
>
>>print i,
>>
>> File "C:/Python22/Numbers", line 1
>> Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
>> ^
>>SyntaxError: invalid syntax
>>
>>
>>
Hi Budman!
If you work qith IDLE you have thoroughly to distinguish to different
modes of working:
1. Interactive Python Interpreter
a) in *Python shell* window
b) waiting for your input, prompting >>>
c) you type in a single Python-statement
d) the interpreter executes it AND gives you the result of the
evaluation - if there is any
e) continue with b)
2. A completely different thing is writing programs, or scripts:
a) Open a "File|New Window" A NEW WINDOW!!!
This will be a mere editor window!
b) There write your code - a sequance of statements - as many as
you like
c) Save it with a name with a *.py extension.
d) Execute it by using
Edit|Run Script IN THE EDITOR-WINDOW, where your code is
e) Program output as well as Error-messages will appear in the
Python-Shell Window.
(THE OTHER ONE) - Study it and dicide on further action - (e. g.
coffe-break)
f) Return to your code in the EDITOR-WINDOW, correct errors or put
in new
portions of code ....
g) continue with c)
While programming from time to time there occurs something, which isn't
quite clear.
At these moments, turn to the Python-Shell window and try out some
test-statements
to clarify your questions. If you have learned, what you wnted to know,
turn to the
EDITOR_WINDOW and incorporate new knoledge into your programs ...
... so have fun!
Gregor
P.S.
File "C:/Python22/Numbers", line 1
Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
^
SyntaxError: invalid syntax
P.P.S.: If you get this, that means, that you saved the
Python-Shell-Window, which doesn't make sense in
your situatuin (except, for instance, you want to show the results to
someone els in the net, sending
her the results viy email)
The text in the *Python Shell* window is no program and cannot be run!
----
Whenever you have been fallen in love with Python, so you can't miss it
any more,
go to www.python.org and download Python 2.2.1 ,
----