# python游戏趣味编程 **Repository Path**: laplacefree/pythongame ## Basic Information - **Project Name**: python游戏趣味编程 - **Description**: 《python游戏趣味编程》《python图像处理实战》《python金融大数据分析》《python和pygame游戏开发指南》 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 6 - **Created**: 2023-03-02 - **Last Updated**: 2023-03-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #### 书单 - scikit-learn机器学习 - TensorFlow+Keras+scikit-learn - 编程的乐趣 接替代码 puzzle - #### Python 开发游戏 - 安装库 1. pip install pygame 2. pip install pgzero 3. pip install Pillow 4. pip install MyQR - 循环嵌套,先遍历内层循环 ```python for i in range(2): for j in range(3): print(i,j) ``` ### python 打包可执行文件 打包命令: 1. pyinstaller -F -n shuxiang shuxiang.py pyinstaller -F -n 表情包 -i icon.ico -w a1.py pyinstaller -F -n 小球轨迹 -i icon.ico -w c1.py 2. pyinstaller -F -n sun sun.py 3. pyinstaller -F -n ball -i icon.ico -w d.py pyinstaller -F -n write -i icon.ico -w e.py 4. pyinstaller -F -n flappyBird -i icon.ico -w flappyBird.py 5. pyinstaller -F -n niddle -i icon.ico -w niddle.py pyinstaller -F -n 地球公转 -i icon.ico -w sun.py 6. pyinstaller -F -n 蒙娜丽莎 -w -i icon.ico a.py #### game 3. pyinstaller -F -n memoryPuzzle -w memorypuzzle.py + import memorypuzzle + memorypuzzle.splitIntoGroupsOf(3, [0,1,2,3,4,5,6,7,8,9]) 4. pyinstaller -F -n slidePuzzle -w slidepuzzle.py 5. pyinstaller -F -n simulate -w simulate.py 6. pyinstaller -F -n wormy -w wormy.py 7. pyinstaller -F -n tetromino -w tetromino.py pyinstaller -F -n tetrominoforidiots -w tetrominoforidiots.py 8. pyinstaller -F -n squirrel -w squirrel.py 9. pyinstaller -F -n starpusher -w starpusher.py 10. pyinstaller -F -n flippy -w flippy.py pyinstaller -F -n inkspill -w inkspill.py pyinstaller -F -n fourinarow -w fourinarow.py pyinstaller -F -n gemgem -w gemgem.py pyinstaller -F -n pentomino -w pentomino.py 具体的命令参数信息如下: -F 表示生成单个可执行文件(one-file),生成结果是一个exe文件,所有的第三方依赖、资源和代码均被打包进该exe内; -n 生成的.exe文件和.spec的文件名 默认:用户脚本的名称,即main.py和main.spec; -w 表示去掉控制台窗口,这在GUI界面时非常有用; -p 表示你自己自定义需要加载的类路径; -i 表示可执行文件的图标