I want to open several cmd windows with OS Windows 10. my code:
import subprocess
for i in range(0, 3):
subprocess.<.....what to do......>
An ideas, how to implement this in the best way?
using os module is pretty straighforward way on how to accomplish it https://docs.python.org/3.4/library/os.html
import os
os.system("start cmd")
subprocess.call(['C:\\Windows\\System32\\cmd.exe'])
This should open a cmd window.
subprocess.call(['C:\\Windows\\System32\\cmd.exe'], -- Arguments Go Here --)
This one will let you add arguements. I'm not sure if you're using these consoles manually or not.
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.