Okay well i've been working in python for a while and ive made a game and it works now but im trying ot put a gui to it and its nooot going so hot.....
the whole code and the place where im getting the syntax is lower down.
Code:
from tkinter import *
class app:
def_init_(self, master);
frame = Frame(master)
frame.pack()
self.label = Label(frame, text="Would you like to play?"
self.button = Button(frame, text="Yes!", command=self.play)
self.button.pack(side=LEFT)
self.button = button(frame, text="NO!!!", command=self.quit)
self.button.pack(side=LEFT)
def play(self):
number = aStr = "dictionary"
a = 'dictionary'
answer = a
answer = ''
print'Descramble this word!!'
print aStr[3] + aStr[6] + aStr[1] + aStr[5] + aStr[0] + aStr[9] + aStr[2] + aStr[8] + aStr[4] + aStr[7]
attempts = 0
while answer != number:
attempts = attempts + 1
answer = raw_input( '?' )
answer = int( '' )
if( answer > number ):
print 'Try Again'
elif( answer < number ):
print 'Wrong'
elif( answer == number ):
print 'you got it rights in %i tries!' %(attempts)
root = Tk()
app = app(root)
root.mainloop()
im getting a syntax error here
Code:
self.button = Button(frame, text="Yes!", command=self.play)
self.button.pack(side=LEFT)