Run python file -- what function is main? -


i have simple python script, 'first.py':

#first.py def firstfunctionever() :     print "hello"  firstfunctionever() 

i want call script using : python first.py , have call firstfunctionever(). but, script ugly -- function can put call firstfunctionever() in , have run when script loaded?

if __name__ == "__main__":     firstfunctionever() 

read more @ docs here.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -