0

I'd like to call a python script (processing.py) within another python script (main.py). The processing.py enters a loop (realtime-processing some audiochannels from an interface) so that the main.py can't proceed. Is there a possibility to start the processing.py in the background and the main program continues with its tasks. I tried to start the two files in separate terminals and it works fine, but i have to pass an argument from the main to the processing script and i don't want to enter the parameters manually in the terminal.

thanks for your help!

1 Answers1

0

You can execute terminal commands inside python code like this:

import subprocess
test = subprocess.Popen("python C:/.../processing.py", stdout=subprocess.PIPE)
test.communicate()

Then if you want them to run in parallel you can use Threading

Manuel
  • 117
  • 2
  • 9