圣诞树-python绘制雪夜圣诞树并封装为小程序
创始人
2024-04-25 10:07:03

绘制雪夜圣诞树并封装为小程序

使用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 packagerun_pyinstaller()File "d:\program files\python370\lib\site-packages\PyInstaller\__main__.py", line 156, in runcompat.check_requirements()File "d:\program files\python370\lib\site-packages\PyInstaller\compat.py", line 761, in check_requirementsf"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

相关内容

热门资讯

猫咪吃了塑料袋怎么办 猫咪误食... 你知道吗?塑料袋放久了会长猫哦!要说猫咪对塑料袋的喜爱程度完完全全可以媲美纸箱家里只要一有塑料袋的响...
demo什么意思 demo版本... 618快到了,各位的小金库大概也在准备开闸放水了吧。没有小金库的,也该向老婆撒娇卖萌服个软了,一切只...
北京的名胜古迹 北京最著名的景... 北京从元代开始,逐渐走上帝国首都的道路,先是成为大辽朝五大首都之一的南京城,随着金灭辽,金代从海陵王...