"Jessica Brink" <[EMAIL PROTECTED]> wrote > I know this seems elementary, but if I write a program and > save it as a .py file, how do I then run that program on the > command line
Just type "python script.py" at the OS prompt Or in *nix you can just type script.py if you havbe a shebang line at the top. > or in the Python Shell (GUI)? You can't run it as such but you can import it. If the script has no if __name__ == '__main__': main() stanza then it will run as if you had executed it, if it has the stanza then you need to call the main funbction manually: >>> import myscript >>> myscript.main() HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor