python模拟shell命令

版权声明:皆为本人原创,复制必究 https://blog.csdn.net/m493096871/article/details/86490212

模拟shell命令
import os

shellTerminal = "[root@python ]$"
while True:
    print(shellTerminal, end="")
    commandFor = str(input())
    if commandFor:
        os.system(commandFor)
        print("")
    if commandFor == "exit":
        break
    else:
        continue

猜你喜欢

转载自blog.csdn.net/m493096871/article/details/86490212