有没有办法可以将命令发送到 Windows 命令提示符 Python?
我想要做的是在桌面上制作一个 Python 应用程序,它通过套接字从另一台计算机/移动应用程序接收命令。
然后将这些命令传递到 Windows 命令提示符以供执行。
使用 Windows 7。
使用子进程模块
from subprocess import call
call(['cmd', 'arg1', 'arg2'], stdin='...', stdout='...')
Run Code Online (Sandbox Code Playgroud)
例如:
call(['dir', '/W'])
Run Code Online (Sandbox Code Playgroud)
在此处阅读更多信息子流程管理
| 归档时间: |
|
| 查看次数: |
5351 次 |
| 最近记录: |