In Python, can I call the main() of an imported module?
It’s just a function. Import it and call it: import myModule myModule.main() If you need to parse arguments, you have two options: Parse them in main(), but pass in sys.argv as a parameter (all code below in the same module myModule): def main(args): # parse arguments using optparse or argparse or what have you if … Read more