Skip to content

Instantly share code, notes, and snippets.

@hkucuk
Created July 16, 2019 20:07
Show Gist options
  • Save hkucuk/d4cb213ce3de907bd366cfa376cebf89 to your computer and use it in GitHub Desktop.
Save hkucuk/d4cb213ce3de907bd366cfa376cebf89 to your computer and use it in GitHub Desktop.
PyWebView Flask Sample
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
Copy link

May I know the requirements.txt for this project? "No module named 'fcntl'" is displayed when I run it on python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment