Search code examples
pythonpython-3.xpython-2.7

Run multiple python file concurrently


how to run multiple files of python simultaneously

I have three files pop.py pop1.py pop2.py i want to run this file concurrently this files are getting run one by one python code to run all files


Solution

  • Make main() function in every python file and then import all the files in your main file. Then call all main functions.

    from . import pop
    from . import pop1
    # and so on
    
    # and now call all main functions
    pop.main()
    pop1.main()
    # and so on