Created
July 16, 2019 20:07
-
-
Save hkucuk/d4cb213ce3de907bd366cfa376cebf89 to your computer and use it in GitHub Desktop.
PyWebView Flask Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
import webview | |
import sys | |
import threading | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello World!' | |
def start_server(): | |
app.run(host='0.0.0.0', port=80) | |
if __name__ == '__main__': | |
t = threading.Thread(target=start_server) | |
t.daemon = True | |
t.start() | |
webview.create_window("PyWebView & Flask", "http://localhost/") | |
webview.start() | |
sys.exit() |
@shin-popol flask
and pywebview
should be enough.
BTW https://github.com/r0x0r/pywebview/tree/master/examples/flask_app is a much more comprehensive example.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
May I know the requirements.txt for this project? "No module named 'fcntl'" is displayed when I run it on python.