【发布时间】:2021-09-23 17:58:40
【问题描述】:
这是我的 python 脚本,我希望它在一个动作完成后循环...... 这里:
print("Booting System (Alfa V1.1)")
time.sleep(1)
print("Hello, and welcome to Training OS")
time.sleep(2)
print("What would you like to do ?")
time.sleep(1)
POINT1 HERE,代码应该从这里循环
txt = raw_input("1.File Explorer 2.System Info. ( 1 or 2 )")
if txt=="1":
print("Loading File Explorer")
time.sleep(1)
print(" _____ _____ \n / | / | \n | | | | \n |_____| |_____| \n File1 File2 ")
time.sleep(0.5)
file = raw_input("1.File1 2.File2 ( 1 or 2 )")
if file=="1":
print("\n\nFile1:"
"\n_______________________________________"
"\nTOP SECRET UPDATE INFO:"
"\n Update Name . . . . 1.2"
"\nEstimated Release Date . . . . 25.09.21"
"\n New Features . . . . Games?"
"\n_______________________________________")
执行后循环到 POINT1
else:
print("\n\nFile2:"
"\n----------------------------------------"
"\n "
"\n Error 404. "
"\n File Missing "
"\n "
"\n----------------------------------------")
执行后循环到 POINT1
else:
print("\n\nSystem Info:"
"\n--------------------------------------------------------------------------------------"
"\n\nOs version: . . . . . 1.1 (New features: File Explorer)"
"\n Founded: . . . . . 22.09.2021, Baku, Azerbaijan"
"\n Products: . . . . . TOS"
"\n\n***This OS is still being developed so some features are currently unaviable :(***"
"\n--------------------------------------------------------------------------------------")
执行后循环到 POINT1
请注意,4 个单独的代码部分彼此相连
如果有人真的能帮助我,那就太酷了,我刚开始学习 python,我真的很想完成这个项目 :)
【问题讨论】:
-
顺便说一句,您使用的似乎是python 2,它已经报废了。
raw_input在 python 3 中更改为input。