本次我们需要使用
pyinstaller
工具,请使用pip3 install pyinstaller
来安装。
还需要easygui
模块,使用同样方法安装。
我们安装成功后,制作一个简单的小游戏:
from random import randint
from easygui import msgbox,integerbox
secret = randint(1,100)
title = '猜数字'
tries = 0
msgbox('现在开始猜数字,数字的范围是1-100!',title)
temp = integerbox("请输入一个数字:",title)
guess = int(temp)