import os
#for i in range(1000):
# 死循环
while True:
cmd = input('[root@test]$')
if cmd:
if cmd == 'exit':
print('logout')
break
print('hello')
else:
print('run %s' %(cmd))
# 运行shell命令
os.system(cmd)
else:
continue
print('hello')
python-break练习
最新推荐文章于 2024-05-24 15:16:08 发布