-app vite application (frontend)
-main.py application entry file
- Enter /app directory
pnpm i
pnpm run dev
- Configure
main.py
if __name__ == '__main__':
api = Api()
window = webview.create_window('pywebview', 'http://localhost:5173', js_api=api, )
webview.start(debug=True)
- Launch the main program
Run main.py
- Enter /app directory
pnpm run build
- Configure
main.py
if __name__ == '__main__':
api = Api()
window = webview.create_window('pywebview + vue3', server, js_api=api, )
webview.start(debug=False)
- Use
auto-py-to-exe
for packaging
pip install auto-py-to-exe
# Launch the tool
auto-py-to-exe
Select the entry point main.py
, and add the gui directory generated from the vite build