I am a beginner and I'm trying to write basic program that should check if the user input (entry) matches with the random word shown (a), or not. If it matches, it should give a new word and the typing field should be cleared.
Here is my code so far:
import random
import requests
import Tkinter
import requests
from Tkinter import *
point = 0
word_site = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain"
response = requests.get(word_site)
WORDS = response.content.splitlines()
a = random.choice(WORDS)
root = Tkinter.Tk()
root.title("Stopwatch")
root.minsize(width=900, height=600)
root.configure(background='white')
e1 = Entry(root , justify='center')
e1.place(anchor=CENTER , bordermode=OUTSIDE)
e1.config(bg="white" , font="Geneva 30 bold")
e1.pack(expand=False, padx=20 , pady=20, ipadx=10, ipady=10)
label = Tkinter.Label(root, text = "Write this word: " + a , bg="white" , font="Geneva 30 bold")
label.pack()
if e1 == a: #virker ikke!
print "correct"
e1.delete(0, END)
root.mainloop()