-1

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

5zigen
  • 3
  • 2

2 Answers2

0
  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')
0

You could use something like explained in this answer.

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

el_gio
  • 56
  • 7