textinput() equivalent in python 2.x

↘锁芯ラ 提交于 2019-12-11 01:34:17

问题


I need to accept info from the user in python's turtle. however the turtle.textinput function only works in versions 3.x and upwards is there an alternative I can use in version 2.X ?


回答1:


This is what textinput actually does:

import tkSimpleDialog
tkSimpleDialog.askstring('title', 'prompt')

It requires you to have a turtle screen open, of course.



来源:https://stackoverflow.com/questions/20105816/textinput-equivalent-in-python-2-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!