Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
amalthomas-exe committed Jan 28, 2021
1 parent d134c35 commit 0c7f0ae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
import os
start = time.time()
import os
import multiprocessing
from flask import Flask, render_template, request
from gevent.pywsgi import WSGIServer
Expand Down Expand Up @@ -323,11 +323,13 @@ def run_server():
app.jinja_env.cache = {}
http_server = WSGIServer(('', 5000), app)
http_server.serve_forever()

def on_close():
t2.kill()
if __name__ == "__main__":
t2 = multiprocessing.Process(target=run_server)
t2.start()
webview.create_window("Wall-E","http://localhost:5000")
window = webview.create_window("Wall-E","http://localhost:5000")
end = time.time()
window.closing+=on_close
print(f"It took {end-start:.2f} seconds to compute")
webview.start()

0 comments on commit 0c7f0ae

Please sign in to comment.