我尝试使用python脚本运行,重新启动并停止apache tomcat 7.0.63,但是当尝试在Windows中运行此脚本时,它没有执行以下命令
catalina.sh jpda start
Apache服务器也没有启动。这是我使用
的脚本#!/usr/bin/python
import os
import subprocess
proc=raw_input("Enter the mode :")
if proc == "start":
os.getcwd()
os.chdir(r"C:\apache-tomcat-7.0.63\bin")
os.getcwd()
subprocess.call('catalina.sh jpda start',shell=True)
print "Tomcat started successfully"
elif proc == "stop":
os.getcwd()
os.chdir(r"C:\apache-tomcat-7.0.63\bin")
os.getcwd()
#subprocess.call('catalina.sh stop',shell=True)
os.system('catalina.sh stop')
print "Tomcat stopped successfully"
elif proc == "restart":
os.getcwd()
os.chdir(r"C:\apache-tomcat-7.0.63\bin")
os.getcwd()
subprocess.call('catalina.sh stop',shell=True)
subprocess.call('catalina.sh start',shell=True)
print "tomcat restarted successfully"
else:
print "error: give any mode"
print "Thank you"
问题是
subprocess.call(' catalina.sh jpda start',shell = True)
无法正常工作如何解决此问题,还有其他原因可以解决此问题