# -*- coding: utf-8 -*-
"""
Created on Sun Dec 30 11:01:31 2018
QQ群:476842922(欢迎加群讨论学习
@author: Administrator
"""
import os
'''
#第一种
print(u'测试开始')
os.system('dir')
os.system('ping 192.168.1.1')
print(u'测试结束')
#第二种
print(u'测试开始')
subprocess.Popen('dir',shell=True)
subprocess.Popen('ping 192.168.1.1',shell=True)
print(u'测试结束')
'''
while True:
str = input("Enter your cmd: ");
print("cmd input is : ", str)
if str=='exit':
break
result = os.popen(str)
res = result.read()
for line in res.splitlines():
print(line)
python编写的cmd程序
最新推荐文章于 2021-08-29 20:39:41 发布