Files
tools/name_code/web/idx.py
flt6 f6658f3d52 First commit
Former-commit-id: 424079609133edcc501ae185509836ee1181a02c
2022-06-12 19:47:20 +08:00

15 lines
375 B
Python

from browser import document
from pickle import load
with open("File.data","rb") as f:
d=load(f)
def run(data):
t=document["name"].value
ans=""
for i in range(len(t)):
try:
ans += d[t[i]]+" "
except KeyError:
document.alert("Can't convert '%s'."%(t[i]))
document["ans"].text=ans
document["check"].bind("click",run)