Yep, you read that well desktop applications using Python and web technologies.
First, install this library:
pip install flaskwebgui
Bellow you have the usage of flaskwebgui:
#main.py
from flask import Flask
from flask import render_template
from flaskwebgui import FlaskUI # import FlaskUI
app = Flask(__name__)
ui = FlaskUI(app, width=500, height=500) # add app and parameters
@app.route("/")
def hello():
return render_template('index.html')
@app.route("/home", methods=['GET'])
def home():
return render_template('some_page.html')
if __name__ == "__main__":
# app.run() for debug
ui.run()
Alternatively, next to main.py create a file called gui.py and add the following contents:
#gui.py
from flaskwebgui import FlaskUI
from main import app
FlaskUI(app, width=600, height=500).run()
Next start the application with:
python main.py
#or
python gui.py #in case you created gui.py
Application will start chrome in app mode, flask will be served by waitress.
And that's all!
Top comments (1)
It would become more awesome if you've added screenshots.