subprocessをimportして実現します。
python3_Sync.py
import subprocess
cmd = "python ./py2.py"
print("subprocess start!!")
#同期実行
subprocess.call(cmd.split())
print("subprocess end!!")
python3_Async.py
import subprocess
cmd = "python ./py2.py"
print("subprocess start!!")
#非同期実行
subprocess.Popen(cmd.split())
print("subprocess end!!")
py2.py
print("py2 hello world!!")
実行結果
python3_Sync.py
subprocess start!! py2 hello world!! subprocess end!!
python3_Async.py
subprocess start!! subprocess end!! py2 hello world!!