绘制雪夜圣诞树并封装为小程序
使用turtle绘制一颗雪夜圣诞树,然后封装成exe小程序送给你的朋友吧!
PS:只能在windows运行。
转载注明本文链接和作者
先看效果图:
绘制雪夜圣诞树
由于代码有三百多行,我放在下面的两个链接了,点击可免费获取
源码下载链接
1.和鲸社区:点击跳转,然后点击右上角Fork后可以下载py文件
2.csdn:点击下载
封装成EXE小程序
1.安装需要的库
pip install auto-py-to-exe -i https://pypi.douban.com/simple/
pip isntall pyinstaller -i https://pypi.douban.com/simple/
pip install pyqt5 -i https://pypi.douban.com/simple/
2.在python终端启动auto-py-to-exe
3.py文件转换
按照图片示例选择,更改脚本位置即可
4.转换完成就可以获取相应的exe文件了
转换中
转换完成:
找到exe文件
5.可能存在的错误
186971 ERROR: An error occurred while packaging
Traceback (most recent call last):
File "d:\program files\python370\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
run_pyinstaller()
File "d:\program files\python370\lib\site-packages\PyInstaller\__main__.py", line 156, in run
compat.check_requirements()
File "d:\program files\python370\lib\site-packages\PyInstaller\compat.py", line 761, in check_requirements
f"The '{name}' package is an obsolete backport of a standard library package and is incompatible with "
SystemExit: The 'typing' package is an obsolete backport of a standard library package and is incompatible with PyInstaller. Please remove this package (located in d:\program files\py
thon370\lib\site-packages) using
"d:\program files\python370\python.exe" -m pip uninstall typing
then try again.
将typing卸载就好了
pip uninstall typing