简体   繁体   中英

How can I make a program that can run cmd commands in python3.x

I trying to make a program that can access other computers in the same network by using the cmd command. I have an administrator password that work in all computers in our network. But I don't know how to make a program that includes cmd commands? Which module should I use or are there other ways to do that?

Use python's os module.

import os
os.system('dir')
os.system('ping 127.0.0.1')

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