I tried running the accepted answer from Does Python have a built in function for string natural sort?, but it gave me the following error:
File " < stdin >", line 4
convert = lambda text: int(text) if text.isdigit() else text
SyntaxError: invalid syntax
Can anyone help please?
Thank you...
Update: Thank you everyone for your responses. I first integrated the code in my own script but received the error. Then I just tested this def on Python interactive window (just this line), and it gives same error.
I am using python/2.6.5. The strange thing is that this code runs on my other computer (Python 2.6.1). Is this code version-specific?