WTF!只需一行 Python 代码即可玩 20 几款小游戏
作者 | Python小二
来源 | Python小二
今天分享一个有趣的 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

好了,这里就不一一列举了,有兴趣的小伙伴可以自己动手试试。

分享
点收藏
点点赞
点在看
关注公众号:拾黑(shiheibook)了解更多
[广告]赞助链接:
四季很好,只要有你,文娱排行榜:https://www.yaopaiming.com/
让资讯触达的更精准有趣:https://www.0xu.cn/

随时掌握互联网精彩
- 1 热爱与坚守 7904783
- 2 中核集团重大突破:成功产出第一桶铀 7809346
- 3 第二代居民身份证迎换证高峰 7714488
- 4 这份防中暑秘籍请收好 7616294
- 5 全国唯一做宝剑的专业:就业率近100% 7523822
- 6 特斯拉车顶维权女车主被判赔17万 7428075
- 7 净网:来看1起侵犯公民个人信息案 7328832
- 8 中山大学133名考生取消录取资格 7237666
- 9 十分钟很短但这是她30年的痛苦 7136958
- 10 邓紫棋小说首日销售额破4000万 7046300