Python子进程.Popen在Windows上以其他用户身份使用 [英] Python subprocess.Popen as different user on Windows

查看:206
本文介绍了Python子进程.Popen在Windows上以其他用户身份使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows上以Python用户身份启动子进程的最佳方式是什么?最好使用XP及更高版本,但如果仅在Vista和7上运行,我也可以使用.

What is the best manner of launching a subprocess as a different user in Python on Windows? Preferably XP and up, but if it works only on Vista and 7, I can live with that too.

推荐答案

我不确定您是否可以使用标准python库执行此操作.但是, pywin32 程序包具有win32process.CreateProcessAsUser 函数,可能就是您所需要的.

I am not sure if you can do this with the standard python libraries. However, the pywin32 package has a win32process.CreateProcessAsUser function which may be what you need.

这篇关于Python子进程.Popen在Windows上以其他用户身份使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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