Python
u010571535
这个作者很懒,什么都没留下…
展开
-
Python 字符串操作(一)
在python有各种各样的string操作函数。在历史上string类在python中经历了一段轮回的历史。在最开始的时候,python有一个专门的string的module,要使用string的方法要先import,但后来由于众多的python使用者的建议,从python2.0开始, string方法改为用S.method()的形式调用,只要S是一个字符串对象就可以这样使用,而不用import。转载 2013-05-23 12:41:31 · 844 阅读 · 0 评论 -
Python 字符串操作(二)
1.字符串的对齐方式: ①:center(int[,str]) >>> string = 'Fishhat' >>> string.center(55) ' Fishhat ' >>> string.center(55,'*') '********************转载 2013-05-23 12:40:50 · 872 阅读 · 1 评论 -
python各种类型转换-int,str,char,float,ord,hex,oct等
int(x [,base ]) 将x转换为一个整数 long(x [,base ]) 将x转换为一个长整数 float(x ) 将x转换到一个浮点数 complex(real [,imag ]) 创建一个复数 str(x ) 将对象 x 转换为字符串 repr(x )转载 2013-05-23 12:44:41 · 808 阅读 · 0 评论 -
Python文件夹与文件的操作
不错的文章,转过来备份:http://www.cnblogs.com/yuxc/archive/2011/08/01/2124012.html 最近在写的程序频繁地与文件操作打交道,这块比较弱,还好在百度上找到一篇不错的文章,这是原文传送门,我对原文稍做了些改动。 有关文件夹与文件的查找,删除等功能 在 os 模块中实现。使用时需先导入这个模块, 导入的方法是: import os转载 2013-05-28 19:25:56 · 638 阅读 · 0 评论 -
re – Regular Expressions 理解完正则学会一半
Finding Patterns in Text import re patterns = [ 'this', 'that' ] text = 'Does this text match the pattern?' for pattern in patterns: print 'Looking for "%s" in "%s" ->' % (pattern, text),翻译 2013-07-03 18:37:39 · 726 阅读 · 0 评论 -
【转】Mac系统更新Python
转自:http://blog.richieliu.com/blog/2013/05/19/macxi-tong-geng-xin-python/转载 2014-05-08 14:51:40 · 1263 阅读 · 0 评论