Beginner trying to understand functions.

Cedric Schmeits cedric.schmeits at gmail.com
Tue Dec 9 08:53:06 EST 2008


the following would be nicer:

def run():
    get_name()
    a = get_age()
    check_age(a)
    again()

if __name__ == "__main__":
    run()


In this setup your script will only be run if it's started by itself,
but when using a import, the functions from the script can be executed
separately.




More information about the Python-list mailing list