Python程序开发
田贝
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python中的Sequence
#coding=utf-8s1 = (1, 2, 3)s2 = [s1, 1, 2]print type(s1), s1print type(s2), s2s2.append(2)print type(s2), s2s2.append(s1)print type(s2), s2print s1[0:2]print s2[0:2]原创 2014-09-03 00:03:26 · 682 阅读 · 0 评论 -
Python中的时间转换
#coding=utf-8from time import strptime, strftimedateStr = '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/pythonpoem = '''\Programming is runWhen the work is doneif 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 · 1061 阅读 · 0 评论
分享