Python-如何对由dict构成的list按字典的某个key值进行排序?
例如:
[
{ "customer": "Franco", "subTime": "2016-12-19 11:03:23" },
{ "customer": "Franco", "subTime": "2016-12-18 21:18:36" },
{ "customer": "Franco", "subTime": "2016-12-17 10:46:53" },
{ "customer": "Rose", "subTime": "2016-12-16 18:48:40" },
{ "customer": "Franco", "subTime": "2016-12-15 16:49:51" },
{ "customer": "Franco", "subTime": "2015-12-15 15:07:22" },
{ "customer": "Franco", "subTime": "2016-12-14 20:13:36" },
{ "customer": "Franco", "subTime": "2016-12-14 20:01:03" },
{ "customer": "Jackson", "subTime": "2015-12-14 18:00:14" },
{ "customer": "Franco", "subTime": "2016-03-08 10:43:08" },
{ "customer": "Franco", "subTime": "2016-02-23 10:52:48" },
{ "customer": "Jackson", "subTime": "2016-02-16 14:27:43" },
{ "customer": "Franco", "subTime": "2016-01-22 14:10:17" },
{ "customer": "Franco", "subTime": "2016-01-11 16:02:55" },
{ "customer": "Franco", "subTime": "2015-12-17 15:46:05" },
{ "customer": "Ronaldo", "subTime": "2016-06-01 17:55:46" },
{ "customer": "Ronaldo", "subTime": "2016-05-18 17:23:30" },
{ "customer": "Ronaldo", "subTime": "2016-02-26 14:38:07" }
]
我想让上例中的list按 subTime
倒序排列, 该如何实现?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论