赞
踩
win10平台下使用pywebview套壳odoo,pyinstaller打包成exe
pip install pywebview
pip install pyinstaller
官方文档 : API | pywebview
webview.create_window(title, url=None, html=None, js_api=None, width=800, height=600, x=None, y=None, screen=None, resizable=True, fullscreen=False, min_size=(200, 100), hidden=False, frameless=False, easy_drag=True, shadow=False, focus=True, minimized=False, maximized=False, on_top=False, confirm_close=False, background_color='#FFFFFF', transparent=False, text_select=False, zoomable=False, draggable=False, server=http.BottleServer, server_args={}, localization=None)
webview.start(func=None, args=None, localization={}, gui=None, debug=False, http_server=False, http_port=None, user_agent=None, private_mode=True, storage_path=None, menu=[], server=http.BottleServer, ssl=False, server_args={}):
webview.settings = { 'ALLOW_DOWNLOADS': False, 'ALLOW_FILE_URLS': True, 'OPEN_EXTERNAL_LINKS_IN_BROWSER': True, 'OPEN_DEVTOOLS_IN_DEBUG': True }
更多详细内容请看官方文档
import webview if __name__ == '__main__': webview.settings = { 'ALLOW_DOWNLOADS': True, 'ALLOW_FILE_URLS': True, 'OPEN_EXTERNAL_LINKS_IN_BROWSER': True, 'OPEN_DEVTOOLS_IN_DEBUG': False } window = webview.create_window(title='Home | 同欣数字化落地', url='https://txodoo.cn/web', width=1360, height=768) webview.start(private_mode=False, debug=True)
pyinstaller --noconsole --onefile --icon=favicon.ico --name txodoo main.py
-- 不显示控制台
--onefile 生成单个可执行文件
--name 指定生成的可执行文件名称
--icon 指定图标
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。