会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
xuekui-jin
博客园
首页
新随笔
联系
订阅
管理
2023年9月12日
python实现结构体排序
摘要: python默认提供的列表sort方法,仅支持列表的元素排序。若想实现结构提排序,可参考下面方法: 1、使用 lambda 表达式 1 class struct: 2 def __init__ (self): 3 self.a = 0 4 self.b = 'a' 5 6 struct_list =
阅读全文
posted @ 2023-09-12 21:16 King--jin
阅读(260)
评论(0)
推荐(0)
公告