Closed jferard closed 4 years ago
def main(param1, param2, param3): script here. if __name__ == "__main__": param1 = ... # param1 = ... param2 = ... param3 = ... main(param1, param2, param3)
Is more flexible than:
def main(): param1 = ... # param1 = ... param2 = ... param3 = ... ################ Parameters to define manually (END) ###################### script here. if __name__ == "__main__": main()
Because the function main may be imported into another script and called with other parameters (e.g. loaded from file):
main
from plot_... import main as plot1 param_by_name = load_from_file() plot1(**param_by_name)
Is more flexible than:
Because the function
main
may be imported into another script and called with other parameters (e.g. loaded from file):