Is there a way to assign the terminal output to a varibale then print it to the screen, using os.popen()
For example:
import os output = os.popen("dir") print(output) Is this possible?
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalIs there a way to assign the terminal output to a varibale then print it to the screen, using os.popen()
For example:
import os output = os.popen("dir") print(output) Is this possible?
os.popenaready usessubprocess- doc: os.popen usessubprocess.Popen()