小弟刚踏入Python不久,也没什么Coding经验..
有个问题想请教各位大大,
倘若今天我用Python执行一个java.jar(如下)
def Java(self, Log, Apptype = '', Hostname = CONFIG.Channel.IP,
Webport = '', Username = CONFIG.User.Name, Password = CONFIG.User.PW):
send = 'java -jar Java.jar'
process = Popen(args=send, shell=True, stdout = subprocess.PIPE, stderr =
subprocess.PIPE)
ret = []
while process.poll() is None:
line = process.stdout.readline()
if line != '' and line.endswith('\n'):
ret.append(line[:-1])
stdout, stderr = process.communicate()
ret += stdout.split('\n')
ret.remove('')
return ret
执行成功跳出一个视窗之后,我还有办法做后续动作吗?
(对视窗做点击动作或是按下Enter之类的)
麻烦各位的回复了,谢谢。