Fork me on GitHub

python3 常用内建模块

datetime:处理日期和时间的标准库

 获取指定日期和时间

 str转换为datetime
from datetime import datetime
cday = datetime.strptime('2015-6-1 18:19:59', '%Y-%m-%d %H:%M:%S')
print(cday)
2015-06-01 18:19:59

 datetime 转换为 str

 

 

 

collections
                (collections是python内建的一个集合模块)
namedtuple

 

deque
defaultdict
OrderedDict
Counter

 

 

 

 
posted @ 2022-08-29 15:00  小百天  阅读(22)  评论(0)    收藏  举报