1st day newbie question.

Luke LLoeffler at home.com
Wed Nov 28 13:20:24 EST 2001


The the code in a text file and save it as spam.py where spam is some 
meaningful name.  You can then say python spam.py at the command prompt 
to run it, or if you are at the prompt you can do an import spam.py to 
run the code...  If there is some main function, you can get it to run 
by adding:
if __name__ == "__main__":
	somefunction()

so somefunction() could be your main logic loop or something.
In a unix enviornment add #!/path/to/python at the top




More information about the Python-list mailing list