从 Python Windows 服务启动 GUI 进程 [英] Starting a GUI process from a Python Windows Service

查看:54
本文介绍了从 Python Windows 服务启动 GUI 进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 Python 创建 Windows 服务类,当满足某些条件时,它最终会显示一个 Window.由于(据我所知)服务不能有 GUI,当条件合适时,我试图在单独的进程中启动 GUI(使用 subprocess.Popen).这不起作用,大概是因为子进程与服务具有相同的权限.

I am creating Windows service class in Python that will eventually display a Window when certain conditions are met. Since (as I understand it) services cannot have GUIs, I'm trying to start up a GUI in a seperate process (using subprocess.Popen) when the conditions are right. This isn't working, presumably because the child process has the same privileges as the service.

那么如何从能够在屏幕上显示 GUI 的 Python Windows 服务启动进程?

So how do I start a process from a Python Windows Service that has the ability to display GUIs on the screen?

推荐答案

如果您授予您的服务 允许服务与桌面交互 权限,它将能够创建窗口而无需启动子进程.

If you give your Service the Allow service to interact with desktop permission it will be able to create windows without the need to launch a subprocess.

这篇关于从 Python Windows 服务启动 GUI 进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆