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
Stanislav Mykhailenko 54fc772c83
Add Lesson 5 Task 2
2023-01-01 22:01:06 +02:00

13 lines
315 B
Python

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)