[英]How do I keep program open in python3
I'm almost new to python and I'm making a kind of command line.我几乎是 python 的新手,我正在制作一种命令行。 I want to make it keep open after pressing enter.
我想让它在按下回车后保持打开状态。 In C#, I used
goto
for example:在 C# 中,我使用
goto
例如:
start:
a = Console.ReadLine("Enter Command:");
goto start;
But now, I don't know how to do that in python.但是现在,我不知道如何在 python 中做到这一点。
There is no goto
in Python. Python 中没有
goto
。 However you can create an infinite loop.但是,您可以创建一个无限循环。
while True:
input()
An example:一个例子:
while True == True:
dum = raw_input("Enter Command:")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.