0
名單我有一個事件類:排序「事件」的Python中
def Event:
def __init__(self, start, end, rule, location, summary):
...
#start, end, and rule are datetime.datetime objects
#location and summary are strings
我有我想start
排序事件的數組,然後通過location
目前我通過start
像這樣對它們進行排序:
events.sort(key=lambda e: e.start)
如何排序位置(字母數字,因爲它是一個字符串)後啓動?
'events.sort(key = lambda e:(e.start,e.location))' – falsetru