WTF!只需一行Python代码即可玩20几款小游戏
【摘要】
今天分享一个有趣的 github 项目:https://github.com/kingser/free-python-games,通过该项目,我们只需一行代码即可玩 20 几款小游戏,下面具体来看一下。
安装
首先,我们进行安装,安装很简单,只需一行命令即可:pip install freegames。
使用
安装完成之后...
今天分享一个有趣的 github 项目:https://github.com/kingser/free-python-games
,通过该项目,我们只需一行代码即可玩 20 几款小游戏,下面具体来看一下。
安装
首先,我们进行安装,安装很简单,只需一行命令即可:pip install freegames
。
使用
安装完成之后,我们使用命令:python -m freegames list
查看一下可玩的游戏列表,如下所示:
ant
bagels
bounce
cannon
connect
crypto
fidget
flappy
guess
life
madlibs
maze
memory
minesweeper
pacman
paint
pong
simonsays
snake
tictactoe
tiles
tron
小游戏的运行(启动)使用命令:python -m freegames.游戏名
,下面通过示例具体看一下。
python -m freegames.snake

python -m freegames.pacman

python -m freegames.flappy

python -m freegames.connect

python -m freegames.cannon

python -m freegames.memory

python -m freegames.pong

python -m freegames.simonsays

python -m freegames.tictactoe

python -m freegames.tiles

python -m freegames.tron

python -m freegames.life

python -m freegames.maze

python -m freegames.fidget

好了,这里就不一一列举了,有兴趣的小伙伴可以自己动手试试。
推荐阅读 点击标题可跳转
文章来源: ityard.blog.csdn.net,作者:Python小二,版权归原作者所有,如需转载,请联系作者。
原文链接:ityard.blog.csdn.net/article/details/124938250
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
作者其他文章
评论(0)