0

I am trying to use pywebview to display html file using inbuilt http server. This ways I can load xlsx file over http fetch() witth Javascript.

Everything works until I pack this into single exe using pyinstaller. It says "Path /index.html not found".

I use this command to build exe: pyinstaller.exe --onefile --noconsole --icon=favicon.ico .\httpd.py

I want to keep index.html and excel file in the same directory as .exe file. (I don't want to pack it to exec, so that excel file can be updated). There is not option set http server root folder as current directory as exe.

Here is httpd.py

import webview
import os
cwd = os.getcwd()

def get_current_url(window):
    window.load_url(window.get_current_url()+'/index.html')
    print(window.get_current_url())

if __name__ == '__main__':
    window = webview.create_window('Application Chart v1', 'index.html', min_size= (1000,800), width=1280, height=1024)
    webview.start(get_current_url, window, http_server=True, debug=True)

Please help!

Nithi2023
  • 423
  • 5
  • 12

0 Answers0