用于 Vista UAC(用户访问控制)的 python IPC(进程间通信)

发布于 2024-07-12 02:44:38 字数 519 浏览 4 评论 0原文

我正在用 (wx)python 编写一个文件管理器 - 很多已经可以工作了。 复制文件时已经有一个进度对话框、覆盖处理等。

现在在 Vista 中,当用户想要将文件复制到某些目录(例如%Program Files%)时,应用程序/脚本需要提升,这在运行时无法要求。 所以我必须启动另一个提升的应用程序/脚本,它可以完成工作,但需要与主应用程序通信,以便后者可以更新进度等。

我搜索并发现很多文章说共享内存和管道是最简单的方法。 所以我正在寻找的是一个“高级”平台独立的 ipc 库,其中使用共享内存或管道进行 python 绑定。

我已经找到了 ominORB、fnorb 等。它们看起来很有趣,但是使用 TCP/IP,是否有使用共享内存或管道的等效库? 由于 ipc 客户端始终位于同一台机器上,因此这里似乎不需要套接字。 我还担心用户必须在他/她的个人防火墙上允许 ipc-socket-通信。

编辑:我真正的意思是高级别:如果能够像使用omniORB时那样调用一些函数而不是将字符串发送到stdin/stdout,那就太好了。

I am writing a Filemanager in (wx)python - a lot already works. When copying files there is already a progress dialog, overwrite handling etc.

Now in Vista when the user wants to copy a file to certain directories (eg %Program Files%) the application/script needs elevation, which cannot be asked for at runtime. So i have to start another app/script elevated, which does the work, but needs to communicate with the main app, so latter can update the progress etc.

I searched and found a lot of articles saying shared memory and pipes are the easiest way. So what i am looking for is a 'high level' platform independent ipc library whith python bindings using shared mem or pipes.

I already found ominORB, fnorb, etc. They look very interesting, but use TCP/IP, is there an equivalent lib using shared mem or pipes ? Since the ipc-client is always on the same machine sockets seems not to be neccesary here. And i am also afraid the user would have to allow ipc-socket-communications on his/her personal firewall.

EDIT: I really mean high level: it would be great to be able to just call some functions like when using omniORB instead of sending strings to stdin/stdout.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

给妤﹃绝世温柔 2024-07-19 02:44:38

使用 stdin/stdout 与第二个进程通信怎么样?

由于输入和输出缓冲,存在一些警告,但请查看此 Python Cookbook 配方,还有 Pexpect,了解如何执行此操作的想法。

How about just communicating with the second process using stdin/stdout?

There are some caveats due to input and output buffering, but take a look at this Python Cookbook recipe, and also Pexpect, for ideas on how to do this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文