Run multiple python files at same time
Question: I understand that we can use Python `multiprocessing` module and will import
`Process` for this.

But what will be our Python code, suppose we want to execute 2 files like
`a.py`, `b.py` at same time.

I was expecting a Python script to include the above and not running files
from two command prompts.

Below is the framework:

    
    
    import multiprocessing
    
    def worker(file):
        #your subprocess code
    
    if __name__ == '__main__':
        files = ["path/to/file1.py","path/to/file2.py","path/to/file3.py"]
        for i in files:
            p = multiprocessing.Process(target=worker(i))
            p.start()
    

What will be subprocess code ?


Answer: Just open two command prompts(in windows) or terminals (in other OS'). Then
run each of the files in one window.

