在python中制作冒险游戏

时间:2012-07-07 14:52:26

标签: python

我正在尝试制作冒险游戏,点击按钮(easygui.msgbox) 点击一个按钮后,它会转到你点击的问题。

1 个答案:

答案 0 :(得分:1)

这里有一个很好的快速介绍:http://www.blog.pythonlibrary.org/2010/05/22/a-quick-easygui-tutorial/;更长的教程是http://www.ferg.org/easygui/tutorial.html

简言之,

import easygui

easygui.msgbox("I am going to ask you a question...")

animal = easygui.buttonbox("What is your favorite animal?", choices=['Tiger', 'Giraffe', 'Llama'])

easygui.msgbox("You chose {}".format(animal))
相关问题