【发布时间】:2010-06-13 17:50:00
【问题描述】:
可能重复:
Python analog of natsort function (sort a list using a “natural order” algorithm)
我确定这很简单,但我想不通。我有一个这样的字符串列表(使用排序后):
Season 2, Episode 1: A Flight to Remember
Season 2, Episode 20: Anthology of Interest I
Season 2, Episode 2: Mars University
Season 2, Episode 3: When Aliens Attack
....
Season 3, Episode 10: The Luck of the Fryrish
Season 3, Episode 11: The Cyber House Rules
Season 3, Episode 12: Insane in the Mainframe
Season 3, Episode 1: The Honking
Season 3, Episode 2: War Is the H-Word
我怎样才能让它们正确排序? (按季节然后第 # 集,上升)
【问题讨论】:
-
你的意思是“按季然后按剧集”对吗?我认为第 2 季和第 3 季的第 1 集不应该放在一起。
-
好的,肯尼。编辑澄清。我会看看另一个问题。