Python程序开发
田贝
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python中的Sequence
#coding=utf-8 s1 = (1, 2, 3) s2 = [s1, 1, 2] print type(s1), s1 print type(s2), s2 s2.append(2) print type(s2), s2 s2.append(s1) print type(s2), s2 print s1[0:2] print s2[0:2]原创 2014-09-03 00:03:26 · 682 阅读 · 0 评论 -
Python中的时间转换
#coding=utf-8 from time import strptime, strftime dateStr = '2014-09-02 11:30' # 将dateStr转化为时间的结构体 parseStr = strptime(dateStr, '%Y-%m-%d %H:%M') # 将parseStr格式化为字符串 coverted = strftime('%Y/%m/%d %H原创 2014-09-02 23:57:39 · 628 阅读 · 0 评论 -
Python中的类和继承
class SchoolMember: '''Represents any school member''' def __init__(self, name, age): self.name = name self.age = age def tell(self):原创 2014-09-03 14:46:45 · 654 阅读 · 0 评论 -
Python中的文件存储
#!/usr/bin/python poem = '''\ Programming is run When the work is done if you wanna make your work also fun: using python ''' f = file('poem.txt', 'w') f.write(poem) f.close() f = file('poe原创 2014-09-03 14:59:32 · 1063 阅读 · 0 评论
分享