Ali
Ali

Reputation: 675

How to run two Python scripts at the same time on Windows

I'm trying to run multiple scripts to maintain the running speed.

I'm using two scripts that need each other to work, so I want another Python script like setup.py to run them:

import os
os.system('python script1.py && python script2.py')

But that doesn't work at the same time.

Upvotes: 0

Views: 690

Answers (1)

Born Ready
Born Ready

Reputation: 3496

maybe you can use multithreading : Python - Multithreading

You will be able to run different python scripts in different threads.

That will allow you to execute them in the same time.

If your script doesnt require a lot of layers of data to process, then you can keep using your processor.

Otherwise you can use your GPU. For example cuda for NVIDIA GPU : See cuda here

Upvotes: 1

Related Questions