一些小文本 。。文件处理啥的。。
嗯Windows·下和LINUX码的不一致 这点需要注意
记得安装xlrd模块 pip install xlrd 转完之后 我是用shell提取插入到数据库 囧还不怎么会用Python提取数据。。。。 晚上回去写注释
#-*- coding: utf-8 -*-
import xlrd
import sys
import re
import codecs
data = xlrd.open_workbook('/tmp/test.xlsx')
table = data.sheets()[0]
nrows = table.nrows
file = open("/tmp/testfile.txt","w")
for i in range(nrows):
l = table.row_values(i)
for k in l:
file.write(str(k.encode('UTF-8'))+"\n")
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30629069/viewspace-2129467/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30629069/viewspace-2129467/