2021
02-26
02-26
python实现简单文件读写函数
python作为脚本性语言,加上它的简便易用性。会经常当作脚本用来处理一下数据和格式。其中处理文件就是频繁用处之一。简单编写几个常用的xls和txt读写函数,以后可以快速复用。用到xlrd库函数需要预先install命令:pipinstallxlrd直接贴源码:#!/usr/bin/python#coding:utf-8importjsonimportxlrdimportsysreload(sys)sys.setdefaultencoding('utf-8')classObjectFileReadAndWrite(object):@classmethoddefreadXlsT...
继续阅读 >