Mam prosty skrypt Pythona 'first.py':Uruchom plik python - jaka funkcja jest główna?
#first.py
def firstFunctionEver() :
print "hello"
firstFunctionEver()
chcę nazwać ten skrypt za pomocą: python first.py
i mieć go nazwać firstFunctionEver()
. Ale scenariusz jest brzydki - jaką funkcję mogę ustawić w rozmowie na firstFunctionEver()
i uruchomić ją po wczytaniu skryptu?
https://stackoverflow.com/questions/419163/what-does-if-name-main-do –