"Autumn Cutter" <autumn...@gmail.com> wrote

I just started learning Python last night and I'm a little stuck on how to write a Python script.
I'm using Python 2.5.0 on a Mac OS X 10.6.4.

To create the program you use any standard text editor - although one that supports programming will be better. So you can use any of the programs you listed. All you need to do is create a new file containg your python code and save
it with a sensible name and end it in .py

So you could create a file called hello.py which contains the single line:

print "Hello"


After you save it open the Terminal application and navigate to the folder where you saved the file. ( ISTR that you can do that by dragging a folder from Finder onto the Terminal... if I'm dreaming use the cd command...)

Now type

python hello.py

at the Unix prompt to get the code to run. You should see hello printed on screen.

Try that and if it doesn't work tell us what happened, including the exact text of
any error messages you see.

There are better ways to run the programs once you get itall set up properly
but for now we will be best to stick to basics!

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to