Home > Enterprise >  Launching python3 script using a python2 script
Launching python3 script using a python2 script

Time:09-15

is there a way to launch a script running on python3 via a python2 script.

To explain briefly I need to start the python3 script when starting the python2 script.

Python3 script is a video stream server (using Flask) and have to run simultaneously from the python2 script (not python3 script first and then python2 script).

The ideal would be to get a function in the python2 script which "open a cmd window and write" it in : python3 script_python3.py

CodePudding user response:

  1. create command in bash file. command is to run script_python3.py, ex: python script_python3.py
  2. then from python2 file, run the .bash file. ex: import os os.popen('sh /scripts/my_bash.sh')

CodePudding user response:

You could use something like explained in this answer.

That use case of that question is a bit different, but the answer should work.

  • Related