I have tried using
#!/bin/bash
python ScriptA.py &
python ScriptB.py &
to run both scripts at the same time but it always returns
You have to import os
module and use the system
function from it, then separate the two Python files you are running by &&
.
import os
def song():
user = input()
if user == "Chance":
os.system('python ScriptA.py && python ScriptB.py')
else:
print("Error")
song()
But I will advice you to just import the two files you want to run into the third file and just run the functions in there like normal functions.
e.g.
import ScriptA
import ScriptB
ScriptA.function()
ScriptB.function()
If there are no functions inside the scripts, the script runs immediately after they are imported.