Python subprocess.Popen as different user on Windows(Python subprocess.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 subprocess.Popen 作为 Windows 上的不同用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Python subprocess.Popen 作为 Windows 上的不同用户
基础教程推荐
- 在 Python 中将货币解析为数字 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
