![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 355 阅读 · 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 · 455 阅读 · 0 评论 -
Python实现遍历目录下所有文件并写到文件中
#coding:utf-8 import urllib2 import urllib import os import shutil homedir = os.getcwd() import os def walk_dir(dir,fileinfo,topdown=True): for root, dirs, files in os.walk(dir, topdown):转载 2013-09-27 17:22:53 · 561 阅读 · 0 评论