0

Below is simple test code named app.py

from flask import Flask
import webview

app = Flask(__name__)

@app.route('/')
def hello_world():
    #print('test') # <- note here
    return 'Hello World!'


if __name__ == '__main__':
    window = webview.create_window(title='app',url=app)
    webview.start()

Build it into exe by following command line

pyinstaller -F -w --noupx app.py

under dist folder there is a app.exe, it runs flawlessly. But if I uncomment the print line, recomplie, it says "ERR_EMPTY_RESPONSE". enter image description here Why?

Additional info:

  1. I also tested logging, as long as there is something printed to console, it crashes.
  2. If compiled without -F flag, exe runs with a ugly black console, printing won't make it crash.
qing6010
  • 99
  • 3
  • 7

0 Answers0