
python
狂风小zhi
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python类型转换、数值操作(收藏)
类型转换代码 int(x [,base ]) 将x转换为一个整数long(x [,base ]) 将x转换为一个长整数float(x ) 将x转换到一个浮点数complex(real [,imag ]) 创建一个复数str(x ) 将对象 x 转换为字符串repr(x )转载 2013-09-27 17:07:32 · 408 阅读 · 0 评论 -
Python 列表(list)操作
创建列表sample_list = ['a',1,('a','b')]Python 列表操作sample_list = ['a','b',0,1,3]得到列表中的某一个值value_start = sample_list[0]end_value = sample_list[-1]删除列表的第一个值del sample_list[0]在列表中插入一个值samp转载 2013-09-27 17:11:52 · 561 阅读 · 0 评论 -
Python实现遍历目录下所有文件并写到文件中
#coding:utf-8import urllib2import urllibimport osimport shutilhomedir = os.getcwd()import osdef walk_dir(dir,fileinfo,topdown=True): for root, dirs, files in os.walk(dir, topdown):转载 2013-09-27 17:22:53 · 609 阅读 · 0 评论