Python 3.x 蟒蛇3海龟如何等待按键
我有一个用蟒蛇3编写的简单游戏Python 3.x 蟒蛇3海龟如何等待按键,python-3.x,turtle-graphics,Python 3.x,Turtle Graphics,我有一个用蟒蛇3编写的简单游戏 游戏结束后,我想显示消息“继续?”?(是/否),并等待用户按下键盘上的按钮。您知道如何实现等待功能吗?查看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 m
游戏结束后,我想显示消息“继续?”?(是/否),并等待用户按下键盘上的按钮。您知道如何实现等待功能吗?查看
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)
不,我不知道yetAlready测试此功能。这不是我想要的。我通过在游戏中添加新场景解决了这个问题。但是谢谢你的回答这是什么“simpledialog”?它似乎不与海龟模块一起提供。