python
文章平均质量分 74
Xsmile2012
这个作者很懒,什么都没留下…
展开
-
python学习总结
字符串操作 a='单引号是字符串,\'是转义符,\n表示换行' a="双引号中可以包含单引号'。" a='''三个单引号'可以表示多段文字 当然,三个双引号"也是一样的效果 ''' 常用函数:find(s, sub[, start[,end]]) rfind(s, sub[, s转载 2011-07-22 17:43:46 · 582 阅读 · 0 评论 -
Python 中的 集合类型 --- set
Python 从 2.4 版引入了一种集合类型 --- set 。Python 2.4 also introduced a new collection type, the set—anunordered collection ofunique and immutable转载 2011-08-16 15:30:05 · 781 阅读 · 0 评论 -
What is `if __name__ == "__main__"` for?
The if __name__ == "__main__": ... trick exists in Python so that our Python files can act as either reusable modules, or as standalone prog翻译 2011-08-16 11:34:11 · 689 阅读 · 0 评论 -
Python常用模块
1.内置模块(不用import就可以直接使用) 常用内置函数: help(obj) 在线帮助, obj可是任何类型 callable(obj) 查看一个obj是不是可以像函数一样调用 repr(obj) 得到obj的表示字符串,可以利转载 2011-08-16 15:01:33 · 721 阅读 · 1 评论 -
linux下python的升级
RHEL 4 自带的Python有点旧了,为python-2.3.4-14.4版本的,所以决定升级到最新版本2.6.2。#rpm -qa |grep pythongnome-python2-2.6.0-3mod_python-3.1.3-5python-devel转载 2011-08-19 16:40:32 · 840 阅读 · 0 评论