摘要:
os.sep 可以取代操作系统特定的路径分隔符。windows下为 '\\' os.name 字符串指示你正在使用的平台。比如对于Windows,它是'nt',而对于Linux/Unix用户,它是 'posix' os.getcwd() 函数得到当前工作目录,即当前Python脚本工作的目录路径 o 阅读全文
posted @ 2016-03-29 18:28
Jarning_Gau
阅读(751)
评论(0)
推荐(0)
摘要:
import shutil with open('/path/to/file', 'r') as f: with open('/path/to/file.new', 'w') as g: for line in f.readlines(): if '/local/server' not in line: ... 阅读全文
posted @ 2016-03-29 16:26
Jarning_Gau
阅读(1474)
评论(0)
推荐(0)
摘要:
from itertools import islice input_file = open(file_name) for line in islice(input_file, 1, None): do_readline() 原文地址:http://blog.csdn.net/vernice/art 阅读全文
posted @ 2016-03-29 15:38
Jarning_Gau
阅读(872)
评论(0)
推荐(0)

浙公网安备 33010602011771号