My main script, main.py runs in python3. within it, I want to launch another script in some specified version of python.
import subprocess
pysh="/data/data/org.qpython.qpy/files/bin/qpython-android5.sh"
subprocess.call([pysh,'filetext.py'])
Question:
How can I use subprocess to open filetext.py in python2.x or 3.x interchangeably?
I have tried:
I have tried inputting several different arguments to no avail, such as:
os.system('python -2 -m filetext.txt')
or
subprocess.call(['py -2 filetext.txt'])
or
subprocess.call(['C:/Python27/python.exe filetext.txt'])
Any help would be immensely appreciated.