so have 2 python project file one is qr scanner and other is youtube downloader. adn both are in different python file
so i wanna create an main python file where i will list the both project name like:
- Qr Scanner
- YouTube Downloader Enter You Option:
So when the user input their option. the script will gonna run in background using another terminal…
i searched in internet i dont understand anything so i didnt tried anything else
i dont know how to do it and where to start it
Advertisement
Answer
It sounds like subprocess is what you want. It allows you to make command line calls by passing arguments to .run()
method.
For example, you can call the ls
bash command to get a list of files in the current directory.
import subprocess as sp out = sp.run("ls", capture_output=True) print(out.sdtout)