-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
25 lines (22 loc) · 859 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import myanmar.encodings
import myanmar.converter
from flask import Flask,render_template,request
app = Flask(__name__)
@app.route('/zawgyitounicode',methods = ['GET','POST'])
def zawgyitouni():
if request.method == 'GET':
return render_template("index.html")
else:
input_mm = request.form['input_mm']
conv = myanmar.converter.convert(input_mm,'zawgyi','unicode')
return render_template('index.html',conv=conv)
@app.route('/unicodetozawgyi',methods = ['GET','POST'])
def unitozawgyi():
if request.method == 'GET':
return render_template("index.html")
else:
input_mm = request.form['input_mm']
conv = myanmar.converter.convert(input_mm,'unicode','zawgyi')
return render_template('index.html',conv=conv)
if __name__=="__main__":
app.run(host="0.0.0.0",port=8080,debug=True)