我有一个用Python3龟编写的简单游戏 游戏结束后我想显示消息'继续? (y / n)'并等到用户按下键盘上的按钮。任何想法如何实现等待功能?
答案 0 :(得分:0)
查看textinput
方法:
def textinput(self, title, prompt):
"""Pop up a dialog window for input of a string.
Arguments: title is the title of the dialog window,
prompt is a text mostly describing what information to input.
Return the string input
If the dialog is canceled, return None.
Example (for a TurtleScreen instance named screen):
>>> screen.textinput("NIM", "Name of first player:")
"""
return simpledialog.askstring(title, prompt)