-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

2 Answers 2

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')
Sign up to request clarification or add additional context in comments.

3 Comments

ok i try this and tell you
I used this finally (near to yours): #!/usr/bin/env python2 from subprocess import Popen Popen('path/to/script_python3.py')
great to hear :)
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.