python: execute command in Windows-Service

こ雲淡風輕ζ 提交于 2019-12-24 17:27:19

问题


I am working on Windows-service written in Python. I'd like to notify user about something, since it seems it cannot be done in service itself I've compiled small program tip.exe, that pops task-bar notifications. Usage is: path/to/tip.exe "title" "notification text" If I use it manully in cmd it works, but all my attempts:

 command='"{}" "{}" "{}"'.format(balloon_exe, title, message)
result=subprocess.Popen(command, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE )
        output, errors = result.communicate()
#######
os.system(command)
#######
os.popen(command)

And some others. There is no error output nor exception... Anyone could help me, please?

来源:https://stackoverflow.com/questions/37058958/python-execute-command-in-windows-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!