我有一个在后台运行的Python代码。我将其添加到Windows Task Scheduler中,并带有以下选项:“无论用户是否登录都运行”(以建立后台工作)
在我的代码中,我有一个带有下一个方法的类:
def start_rebuild(self):
full_command_name = '"' + CUSTOM_BUILD_BAT_FILES[self.module] + '"'
full_command_name += ' ' + str(self.hidden_flag) + ' ' + str(self.deploy_flag) + ' ' + str(self.reload_flag)
full_command_name += ' ' + self.client
print(full_command_name)
self.rebuild_status = Popen(full_command_name, shell=True)
def get_status(self):
"""
:return: status of running process
"""
if self.rebuild_status.poll() is None:
status = 'Running'
elif self.rebuild_status.poll() is 0:
status = '*Success*'
elif self.rebuild_status.poll() is 1:
status = '`Error`'
else:
status = '`Unknown`'
return status
当我调用“ start_rebuild()”函数时,它在后台运行,但是我希望它在单独的可见窗口中。我该怎么办?