HLEP: I have a problem about interpreting Error Message

labien at netian.com labien at netian.com
Sat May 22 03:39:07 EDT 1999


for my use, I download a program written by phyton using Tkinter.
but When i ran that program, it appear following error message.
---------------------------------------------------------------------
SyntaxError: non-default argument follows default argument (line 165)
---------------------------------------------------------------------
line 165 is below
---------------------------------------------------------------------
def __init__(self, master=None, title, text, bitmap,
		 default=0, args=['Yes', 'No'], cnf={}, **kw):
---------------------------------------------------------------------
for fixing that problem, I read python and tkinter manual..
but i can't find what parameters generate error.
therefore i post..

for your understanding..i also post that  classe
Please Help
thanx..
good day.

----------------------------------------------------------------------
class non_modDialog(Toplevel):
    ''' exactly the tk dialog, but nonmodal
    '''
    # to implement: all args installing as buttons
    def __init__(self, master=None, title, text, bitmap,
		 default=0, args=['Yes', 'No'], cnf={}, **kw):

	try:
	    if kw:
		cnf = _cnfmerge((cnf, kw))
	    Toplevel.__init__(self)
	    self.widgetName = '__non_modDialog'
	    self.title(title)
#	    self.iconname('%s'%self.__class__)

	    self.text = text
	    self.bitmap = bitmap
	    self.default = default
	    self.args = args
	    self.num = default

	    self.top = Frame(self, relief=RAISED, bd=1)
	    self.top.pack(side=TOP, fill=BOTH)
	    self.bot = Frame(self, relief=RAISED, bd=1)
	    self.bot.pack(side=BOTTOM, fill=BOTH)

	    self.mesg = Message(self.top, text=self.text,
width='3i')   # ,
#				font='-*-Times-Medium-R-*--*-180-
*')
	    self.mesg.pack(side = TOP, expand=YES, fill = BOTH,
			   padx = '5m', pady = '5m')

	    Button(self.bot, text=args[0], command=self.ok).pack
(side=LEFT,

expand=YES)
	    Button(self.bot, text=args[1], command=self.cancel).pack
(side=LEFT,

	expand=YES)
#	    self.withdraw()
#	    self.update_idletasks()

	    x = (self.winfo_screenwidth()/2 - self.winfo_reqwidth()/2
\
		 - (self.winfo_vrootx()))
	    y = (self.winfo_screenheight()/2 - self.winfo_reqheight
()/2 \
		 - (self.winfo_vrooty()))
	    self.geometry(('+%d'%x)+'+%d'%y)
#	    self.deiconify()

	except:
	    self.destroy()

    def ok(self):
	self.destroy()

    def cancel(self):
	self.num = 1
	self.destroy()
	return 1


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---




More information about the Python-list mailing list