textinput(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:
>>> textinput("NIM", "Name of first player:")
如果使用python3,一个简单的接口是添加到turtle的
textinput()
(和numinput()
)命令:这既可以宣布游戏结果,也可以询问用户是否想再次玩。不是很复杂,但当你重新启动游戏的逻辑时,可能会充当替身。在
使用
turtle.write(text)
然后可以使用tkinter将按钮放在turtle屏幕上。或者,Python有一个非常简单的GUI,称为EasyGUI。在安装使用:
用法:
^{pr2}$相关问题 更多 >
编程相关推荐