Chris Rebert wrote:
On Sat, Feb 21, 2009 at 8:46 PM, Peter Anderson
<peter.ander...@internode.on.net> wrote:
I have just installed Python 3. I have been using Tkinter and easygui (with
Python 2.5.4) for any GUI needs. I have just started to port some of my
existing scripts to Python 3 and discovered problems with easygui.

I was using the following script for testing:
<snip>

File "C:\Python30\lib\site-packages\easygui.py", line 824, in __choicebox
choices.sort( lambda x,y: cmp(x.lower(), y.lower())) # case-insensitive sort
TypeError: must use keyword argument for key function

Change the line to

choices.sort(key=lambda x,y: cmp(x.lower(), y.lower()))

The key function must take one arg, not two, as with Gabriel's solution: str.lower.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to