[Tutor] simple problem

alan.gauld@bt.com alan.gauld@bt.com
Sun, 31 Mar 2002 23:08:06 +0100


> for on mac os 10, and i am using it through terminal

MacOS X is catching on...

> i try to put a line of code and and then try to put
> another underneath it, i have to hit return, and
> python runs through the code, so what happens if i
> want to put more than 1 line of code 

You can put your code in a file. Use textedit to create 
a file with a .py extension(by convention). Then in terminal type:

$ python foo.py

where $ is the unix prompt
python is the interpreter
foo.py is the file you created.

Yu can also use vi or emacs within terminal which is how real 
unix heads do it, but textedit will suffice - just make 
sure you save as plain text.

> python GUI, or the IDLE, 

I'm sure someone will have pointed you to Danny's IDLE tutor 
by now. Just remember you need to run an Xserver like XonX 
to use IDLE on MacOS X.

Alan g