Re: [Tkinter-discuss] tkFileDialog.askopenfilenames returns unicode string instead of tuple in python 2.62

2009-07-30 Thread Guilherme Polo
2009/7/30 Johnny Vestergaard : > Hi, > > I recently upgraded from Python 2.4 to Python 2.6.2 and have had some > unexpected issues with unicode. > > I had the following code working properly in 2.4: > > ---code start--- > import Tkinter > import tkFileDialog > root = Tkinter.Tk() > input_files = tk

Re: [Tkinter-discuss] tkFileDialog.askopenfilenames returns unicode string instead of tuple in python 2.62

2009-07-30 Thread Johnny Vestergaard
Johnny Vestergaard skrev: I dident really find out why this happens, but figured out a workaround: def string2list(input_string): input_string = input_string.lstrip('{') input_string = input_string.rstrip('}') output = input_string.split('} {') return output import Tkinter import tk

[Tkinter-discuss] tkFileDialog.askopenfilenames returns unicode string instead of tuple in python 2.62

2009-07-30 Thread Johnny Vestergaard
Hi, I recently upgraded from Python 2.4 to Python 2.6.2 and have had some unexpected issues with unicode. I had the following code working properly in 2.4: ---code start--- import Tkinter import tkFileDialog root = Tkinter.Tk() input_files = tkFileDialog.askopenfilenames(filetypes = [('.TXT f

Re: [Tkinter-discuss] Passing arguments to command in button.bind

2009-07-30 Thread Johnny Vestergaard
Thanks to both Sorin and Cameron for the lambda trick which did the job. Sorin Schwimmer skrev: lambda is your friend: optiondict[option].bind("", lambda t='this is a string i want to pass': self.newdestination(t)) HTH SxN __

[Tkinter-discuss] Declarative-like tkinter code

2009-07-30 Thread Francesco Bochicchio
Hi all, I played a little to see how one could write gui-building code with Tkinter in a more 'declarative' way, sorta like a DSL, and also - and more importantly - less redundant. After a few iterations I got this: # code begin top = Tk( 'top' ) # first argument of any widget is the name