用于 Vista UAC(用户访问控制)的 python IPC(进程间通信)
我正在用 (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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 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.