简体   繁体   中英

How to interact with the running process in python?

For example, I opened power-shell manually in windows.Now I know process id of it. So I want to run commands on the process using python.

Open power-shell manually. Find its process id. Execute commands using its process id.

Please mention code to do it **

您可以使用子流程python标准库https://docs.python.org/2/library/subprocess.html来完成所有操作

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM