码迷,mamicode.com
首页 > 编程语言 > 详细

python技巧记录

时间:2018-03-21 19:56:36      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:记录   python技巧   div   style   reverse   nbsp   from   字典   list   

1. 对字典按value排序

sorted(d.items(),key = lambda x:x[1],reverse = True)

2. 模糊搜索路径

from glob import glob
lists = glob(r./*.txt)   #return all txt file

 

python技巧记录

标签:记录   python技巧   div   style   reverse   nbsp   from   字典   list   

原文地址:https://www.cnblogs.com/dxs959229640/p/8618775.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!