
python
xdhc304
这个作者很懒,什么都没留下…
展开
-
python删除指定文件
#! python 3 # -*- coding:utf-8 -*- ''' Copy指定格式的文件到新文件夹 ''' import shutil,os,send2trash #定义函数,接收传入的值 def SFileToDFile(sourcefile,fileclass,destinationfile): #遍历目录和子目录 for filenames in os.listd...原创 2019-11-26 15:21:47 · 709 阅读 · 0 评论 -
python将指定目录下的指定格式文件复制到目标目录下
#! python 3 # -*- coding:utf-8 -*- # Autor: Li Rong Yang ''' Copy指定格式的文件到新文件夹 ''' import shutil,os #定义函数,接收传入的值 def SFileToDFile(sourcefile,fileclass,destinationfile): #遍历目录和子目录 for filenames ...原创 2019-11-26 15:20:04 · 770 阅读 · 0 评论 -
python读取文件UnicodeDecodeError: 'gbk' codec can't decode byte 0xfe in position 575056: illegal multiby
open('order.log','r', encoding='UTF-8') 改为 open('order.log','rb')原创 2019-09-22 13:50:52 · 461 阅读 · 0 评论 -
python: NameError: name 'cmp' is not defined
python 3.4.3 的版本中已经没有cmp函数,被operator模块代替,在交互模式下使用时,需要导入模块。 lt(a,b) 相当于a<b 从第一个数字或字母(ASCII)比大小 le(a,b)相当于a<=b eq(a,b)相当于a==b 字母完全一样,返回True, ne(a,b)相当于a!=b gt(a,b)相当于a>b ge(a,b)相当于a>...原创 2019-09-22 14:31:38 · 3941 阅读 · 0 评论