今天帮同事用Python写了一个小工具,实现了在linux下批量文件名和去掉windows 文件到linux过程中产生^M的脚本,代码如下: !/opt/exptools/bin/python import os,os.path,sys import shutil,string dir ='/home/alzhong/tools/zch/filedir' for i in os.listdir(dir): newfile = i.replace('.s.txt','.s') oldfullfil
python中list的操#python创建列表的时候,会以堆栈的形式存放数据,从右向左往堆栈中存放数据 movies=["The holy Grail","The life of brain","The meaning of life"] movies=[]movies=list() #创建一个空的列表 #len()表示长度print(len(movies))#python append在列表的末尾添加一个元素movies.append(&qu