This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
NG_2022_Stanislav_Mykhailenko/Lesson_5/Task 2/webserver.py

14 lines
315 B
Python
Raw Normal View History

2023-01-01 20:01:06 +00:00
from flask import Flask, render_template, redirect, request
from datetime import datetime
app = Flask("Calculator")
@app.route('/')
def index():
result = None
if 'operation' in request.args:
result = eval(request.args.get('operation'))
return render_template("index.html", result=result)
app.run(port=8080)