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 守护好中华文脉并让文物活起来 4975731
- 2 警方通报胖猫事件:女方不构成诈骗 4909571
- 3 伊朗总统乘坐的直升机“硬着陆” 4808179
- 4 文旅“热”澎湃经济脉动 4718343
- 5 央媒评“指豚为鱼”:何其讽刺 4608656
- 6 胖猫姐姐操控舆论 小号曝光女方信息 4581393
- 7 为什么520这么多学生请病假? 4478853
- 8 南京通报网友举报遇鬼秤被摔手机 4330371
- 9 河南网友山中发现日寇坟墓? 4201984
- 10 英国年度最性感男人 4185981