2019年8月23日

摘要: datetime模块用于是date和time模块的合集,datetime有两个常量,MAXYEAR和MINYEAR,分别是9999和1. datetime模块定义了5个类,分别是 1.datetime.date:表示日期的类 2.datetime.datetime:表示日期时间的类 3.dateti 阅读全文
posted @ 2019-08-23 16:00 python-小胖 阅读(217) 评论(0) 推荐(0)
摘要: 1. 常用方法 2.字符串常量 3.字符串模板Template 通过string.Template可以为Python定制字符串的替换标准,下面是具体列子: >>>from string import Template >>>s = Template('$who like $what') >>>pri 阅读全文
posted @ 2019-08-23 15:41 python-小胖 阅读(323) 评论(0) 推荐(0)
摘要: 1.字符串属性方法操作: 1.>字符串格式输出对齐 1 2 3 4 5 6 7 8 9 10 11 >>> str = "Python stRING" >>> print str.center(20) #生成20个字符长度,str排中间 Python stRING >>> print str.lju 阅读全文
posted @ 2019-08-23 15:37 python-小胖 阅读(115) 评论(0) 推荐(0)

导航