作者 |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-mfreegames.snake
python-mfreegames.pacman
python-mfreegames.flappy
python-mfreegames.connect
python-mfreegames.cannon
python-mfreegames.memory
python-mfreegames.pong
python-mfreegames.simonsays
python-mfreegames.tictactoe
python-mfreegames.tiles
python-mfreegames.tron
python-mfreegames.life
python-mfreegames.maze
python-mfreegames.fidget
好了,这里就不一一列举了,有兴趣的小伙伴可以自己动手试试。
分享
点收藏
点点赞
点在看
文章转发自AI科技大本营微信公众号,版权归其所有。文章内容不代表本站立场和任何投资暗示。
Copyright © 2021.Company 元宇宙YITB.COM All rights reserved.元宇宙YITB.COM