I have tried to run your code, so I made some modifications to make it run on my python 3.7 in the windows operating system. The following modifications and corrections:
1- use input
instead of raw_input
2- use:
f = open("words.txt", "r")
dictionary = f.readlines()
instead of file('words.txt')
3- and of course use print(something)
instead of print something
.
4- adding to the end of your code the run command:
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=1)
5- Indentation in the function def check(x, y):
should be corrected `
6- Adding the missing :
in if request.form.get("Word")
Finally, the program runs, but you use input from console like raw_input
or input
, meanwhile, you run Flask
web server, so you should use forms to get the user inputs.
It would be good if add a sample input data and some lines of the file words.txt
Good Luck:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…