Launch Python 3.x from under python 2.x (or IronPython)
Run a script written in Python 3.x
If possible, get the output and return it to Python 2.x
PS And is it possible to place the body of the script for Py3 in the body of Py2?
Launch Python 3.x from under python 2.x (or IronPython)
Run a script written in Python 3.x
If possible, get the output and return it to Python 2.x
PS And is it possible to place the body of the script for Py3 in the body of Py2?
If python3 installed on the computer, for example, you can run a script interpreter through the subprocess module.
An example of running the python interpreter. sys.executable - the full path to the interpreter, you can replace, for example, the line "C: \ Python3 \ python.exe", which executes the script <script>.py . The script <script>.py writes something to the console, we catch it and write to our console:
from subprocess import Popen, PIPE import sys if __name__ == '__main__': with Popen([sys.executable, '-u', '<script>.py'], stdout=PIPE, universal_newlines=True) as process: for line in process.stdout: print(line, end='') sys.argv ) to a running script? - gil9redSource: https://ru.stackoverflow.com/questions/505408/
All Articles