executing main function of a py file from another py files code example
Example 1: run py file in another py file
os.system('python my_file.py')
Example 2: python main
if __name__ == "__main__":
# execute only if run as a script
main()
os.system('python my_file.py')
if __name__ == "__main__":
# execute only if run as a script
main()