sorted

Discussion in 'Python' started by thomas, Aug 18, 2006.

  1. thomas

    thomas Guest

    Hi NG

    I what to used the sorted function, and im getting this error

    Traceback (most recent call last):
    File "F:\home\thomas\src\guisample\test1.py", line 59, in ?
    main()
    File "F:\home\thomas\src\guisample\test1.py", line 31, in main
    sorted(cords, key=operator.itemgetter(1))
    NameError: global name 'sorted' is not defined

    what do I needs to import, to use this function ?

    regards
    thomas
     
    thomas, Aug 18, 2006
    #1
    1. Advertising

  2. On Fri, 18 Aug 2006 09:31:54 +0200, thomas <> declaimed
    the following in comp.lang.python:

    > I what to used the sorted function, and im getting this error
    >

    <snip>
    >
    > what do I needs to import, to use this function ?
    >

    Uhm... the entire 2.4 version of Python?

    You don't mention what version you have, but sorted() is new with
    2.4
    --
    Wulfraed Dennis Lee Bieber KD6MOG

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
     
    Dennis Lee Bieber, Aug 18, 2006
    #2
    1. Advertising

  3. thomas

    thomas Guest

    Dennis Lee Bieber skrev:
    > On Fri, 18 Aug 2006 09:31:54 +0200, thomas <> declaimed
    > the following in comp.lang.python:
    >
    >> I what to used the sorted function, and im getting this error
    >>

    > <snip>
    >> what do I needs to import, to use this function ?
    >>

    > Uhm... the entire 2.4 version of Python?
    >
    > You don't mention what version you have, but sorted() is new with
    > 2.4


    Sorry

    I am using 2.3.
    So now I know what to do :)


    Thanks for the quick answer

    regards
    thomas
     
    thomas, Aug 18, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Baulch
    Replies:
    0
    Views:
    1,947
    Nathan Baulch
    Jun 26, 2003
  2. Replies:
    0
    Views:
    378
  3. Steve Caliendo

    Any control with Sorted property ?

    Steve Caliendo, Feb 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    328
    Martha[MSFT]
    Feb 28, 2004
  4. Jason
    Replies:
    5
    Views:
    2,229
    Curt_C [MVP]
    Jun 10, 2004
  5. Andy Sutorius

    Sorted List Snapshot?

    Andy Sutorius, Jun 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    412
    Derek Harmon
    Jun 3, 2005
Loading...

Share This Page