Python
文章平均质量分 58
残阳
随IT 潮起潮落,看人生起起伏伏!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python文件管理中的file、seek、truncate
一、先介绍下file、seek、truncate的基本用法: seek(offset,where): where=0从起始位置移动,1从当前位置移动,2从结束位置移动。当有换行时,会被换行截断。seek()无返回值,故值为None。 tell(): 文件的当前位置,即tell是获得文件指针位置,受seek、readline、read、readlines影响,不受转载 2014-01-23 15:22:38 · 2950 阅读 · 0 评论 -
python之os.walk()与os.path.walk()
os.walk() 函数声明:walk(top,topdown=True,onerror=None) 1>参数top表示需要遍历的目录树的路径 2>参数topdown的默认值是"True",表示首先返回目录树下的文件,然后在遍历目录树的子目录.Topdown的值为"False"时,则表示先遍历目录树的子目录,返回子目录下的文件,最后返回根目录下的文件 3>参数onerror的默认值是"No转载 2014-01-16 11:47:30 · 1418 阅读 · 0 评论 -
python中os.path常用模块
python中os.path常用模块 os.path.sep:路径分隔符 linux下就用这个了’/’ os.path.altsep: 根目录 os.path.curdir:当前目录 os.path.pardir:父目录 os.path.abspath(path):绝对路径 os.path.join(): 常用来链接路径 os.path.split(path): 把p转载 2014-01-16 11:40:23 · 11386 阅读 · 0 评论 -
use python to get file list
android python tool to get file list import operator, os, sys def get_file_size(path): st = os.lstat(path) return st.st_size; def main(argv): output = [] roots = argv[1:]转载 2014-01-16 12:41:10 · 3251 阅读 · 0 评论 -
python有各种各样的string操作函数
在python有各种各样的string操作函数。在历史上string类在python中经历了一段轮回的历史。在最开始的时候,python有一个专门的string的module,要使用string的方法要先import,但后来由于众多的python使用者的建议,从python2.0开始, string方法改为用S.method()的形式调用,只要S是一个字符串对象就可以这样使用,而不用import。转载 2014-01-23 14:41:41 · 918 阅读 · 0 评论 -
how to unzip split file
1. how to unzip split file cat zipfile.tar.gz* |tar -zxv转载 2015-03-23 10:38:05 · 1243 阅读 · 0 评论
分享