datafile.txt #文件 Man: this is the right room for an argument. Other Man: I've told you once. Man: No you haven't Other Man: Yes, I have. (pause) Man: When? Other Man: Just now. Man: No you didn't Other Man: Yes I did. Man: You didn't Other Man: I'm
压缩.log 文件为zip后删除原文件 需要注意:本人作为小白,该脚本需要和.log在一起,后面有时间需要改正. #!/usr/local/python/bin/python #-*-coding=utf8 -*- import time import os import sys import zipfile N = 7 #设置删除多少天前的文件 def zip(srcpath): for folder,sumfolder,files in os.walk(srcpath): for file
#.python学习笔记:在文本编辑器中新创建一个文件,写几句话老总结你至此学到的python知识 #其中‘In Python you can’ 打头.将这个文件命名为learning_python.txt.并将其存储到为本章学习目录下 #编写一个程序,它读取这个文件,并将你序偶写的内容打印三次:第一次打印时读取整个文件 #第二次打印时遍历文件对象,第三次打印时将各行存储在一个列表中,再在with代码块外打印它们 with open('learning_python.txt') as file_