0
我想在子進程中調用/etc/init.d/tomcat6。 我試過下面的代碼,但它沒有奏效。如何使用子進程在Python中調用「/etc/init.d/tomcat6/ stop」
cmd="/etc/init.d/tomcat6/ stop"
p=subprocess.Popen(cmd)
stdout, stderr = p.communicate()
print stdout,stderr
任何人都可以幫助我,謝謝。