【发布时间】:2014-08-23 17:31:05
【问题描述】:
我是 Python 编程语言的新手。如果确实如此,那是我的第一天。 我正在制作一个终端,代码在这里可见:Pastebin link 我不想代码循环从这里 (/###) 到这里 (###/)。
/###
lastcommand = input("C-Gen@H//Vilius #OpDesc: ")
if lastcommand == "info":
print (info)
elif lastcommand == "list1":
print (list1)
elif lastcommand == "list2":
print (list2)
elif lastcommand == "list3":
print (list3)
elif lastcommand == "session_name":
print (session_name)
elif lastcommand == "myName":
print (myName)
elif lastcommand == "currentloc":
print (currentloc)
elif lastcommand == "currentfold":
print (currentfold)
elif lastcommand == "filenameloc":
print (filenameloc)
elif lastcommand == "cpu":
print (cpu)
else:
print ("Error: incorrect command (" + lastcommand + ")")
###/
【问题讨论】:
-
您希望它何时循环播放?多长时间?
-
从lastcommand输入到else语句后打印,永远
-
好吧,它只说如何使数字循环,而不是代码循环。
-
注意在 python 中缩进是语法的一部分
-
是的,描述有点错误。