Ask coding questions

← Back to all posts
Is There A Way To Run HTML In Python Code.
BenJones12 (0)

Im Trying To Learn HTML To Make Better GUI's. Is There Any Way To Make Python Run A HTML File Or Code In The Console.(Without Taking It To A Webpage/External System) Thanks.

Comments
hotnewtop
InvisibleOne (2776)

Unless you make it a webpage using Flask or Django, there isn't really a way to run HTML in the console

VulcanWM (2473)

Yeah it’s pretty easy

from flask import Flask
app = Flask('app')

@app.route('/')
def hello_world():
  return '<p>Hello there!</p>'

app.run(host='0.0.0.0', port=8080)