项目地址
DefensiveSniper/Amatuer
flask+electron
打包flask
pyinstaller --onefile --noconsole --name=flask_server --add-data "templates;templates" --add-data "static;static" --add-data "func;func" --collect-binaries azure.cognitiveservices.speech flask_server.py
解释:
--onefile
:打包成一个独立的文件--noconsole
:隐藏终端窗口,避免黑框弹出--add-data "templates;templates"
:添加数据,防止找不到关联文件--name=flask_server
:生成flask_server.exe
成功后,dist/
目录下会生成 flask_server.exe
打包 Electron
安装 Electron 及构建工具
npm install
npm install -g electron electron-builder wait-on concurrently
修改 package.json
在 package.json
里,添加:
"build": {
"appId": "com.yourapp.id",
"productName": "AmatuerApp",
"win": {
"target": "nsis",
"icon": "static/images/logo.ico"
}
}
执行打包,onlyWindows
electron-builder --win --x64
ps:记得改版本号
运行
npm run start
ps:记得在main.js中变动调试代码
日志
2025.2.6 AmatuerApp1.0.0
2025.2.6 AmatuerApp1.0.1 修复了应用伪关闭的问题
2025.2.7 AmatuerApp1.1.0 添加了AI交流,支持DeepSeek和OPENAI的多种模型
2025.2.8 AmatuerApp1.1.2 在ai交流页面添加“新聊天”按钮,优化“配置”设置
2025.2.16 AmatuerApp1.1.3 添加了AI交流上下文
With dedicated attention to small and medium enterprises, BusinessIraq.com provides essential coverage of entrepreneurial developments, startup ecosystems, and business support initiatives across Iraq. Our platform helps local and international businesses navigate Iraq’s dynamic market landscape, supporting economic growth and development throughout the country.