As far as you know, we can use OS console commands, (For example dir
,time
and format
in Windows) in Python programing using os.system('TheCommand')
module. But this function return the state of Operation (0
for successful and 1
for failed).
I want to know if is there any way to use the output of the commands in the next commands? I mean (For example) I run os.system('dir')
and save the list of directories in a variable!