Answer the question
In order to leave comments, you need to log in
How to put the result from os.system into a variable?
hello everyone, how to put the result from os.system into a variable. If you put in , then the console will display the work of this program, and in it will be 0 a = os.system("youtube-dl -параметры")
print(a)
Answer the question
In order to leave comments, you need to log in
os.system only starts the process, it doesn't capture the result.
If you need to get the result of the execution, then as an option you can do it like this:
import subprocess
a = subprocess.check_output('youtube-dl -параметры', shell=True)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question