cx_Freeze
https://cx-freeze.readthedocs.io/en/latest/setup_script.html#
setup.py
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {
"excludes": ["tkinter", "unittest"],
"zip_include_packages": ["encodings", "PyQt5"],
}
# base="Win32GUI" should be used only for Windows GUI app
base = "Win32GUI" if sys.platform == "win32" else None
setup(
name="AutoUpdate",
version="1.0",
description="自动程序",
options={"build_exe": build_exe_options},
executables=[Executable("autoupdatewidget.py", base=base)],
)
python setup.py build
Pyinstaller
pyinstaller --noconsole --onefile --icon .\autoupdate.ico .\autoupdatewidget.py
python windows 360查杀问题
最近做了一个python exe程序,桌面端程序,启动之后被360给查杀了。说是木马
上网找资料,各种试
屏蔽os调用那种方法不知道可以不,但是我项目中用了太多os。避免不了。
最后使用了icon可以了,图标打包时把所有格式都嵌入进去。
具体icon的制作方法参照
https://blog.csdn.net/sevendemage/article/details/136495497