Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 05-05-2008, 05:31 PM   #1 (permalink)
DawnOfDoom's Avatar
 
Ultra Techie

Join Date: Jan 2007

Location: North Carolina

Posts: 994

DawnOfDoom is on a distinguished road

Send a message via MSN to DawnOfDoom Send a message via Yahoo to DawnOfDoom
Default Tkinter Error in Python

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)

__________________
Quote:
Originally Posted by Oreo View Post
That was an epic forum speech, Doom is tech-forums very own Martin Luther King.
Don't Tell any one but I know who Crunch is...

I Do accept support requests via PM, MSN, and e-mail

If I have been helpful to you in any way please click the scale under my name
DawnOfDoom is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python Restart sinci Programming Discussions 3 02-24-2008 11:29 AM
Is it worth learning Python? Saxon Programming Discussions 1 05-25-2007 01:52 PM