can we write a script in python that runs dos commands/dos mode? Eg: I have a command
megarec.exe -cleanflash .1
which supposed to run only on dos mode.I do it manually.Now i need to write a script which automates the above procedure.can i do it?
can we write a script in python that runs dos commands/dos mode? Eg: I have a command
megarec.exe -cleanflash .1
which supposed to run only on dos mode.I do it manually.Now i need to write a script which automates the above procedure.can i do it?
import subprocess
ch=subprocess.Popen("megarec.exe -cleanflash .1",shell=True,stdout=subprocess.PIPE,stderr=subrocess.PIPE)
output,err=ch.communicate()
if output:
print "success:",output
else:
print "error:",error