Python学习笔记(15)-Python常用模块总结1.datetime2.collections模块以后用到了再来补充
1.datetime1.1 获取当前的日期和时间代码:from datetime import datetimenow = datetime.now()print (now)print (type(now)) # 类型是datetimeprint (now.year) # 获得datetime的年 同理 月month,日day,时hour,分minute,秒secondprint (now