将关键词列表文件转成python的list

来源:岁月联盟 编辑:exp 时间:2012-08-13
file_src = open('src.txt')
file_dst = open('dst.txt','w+')
file_dst.write("[")
for line in file_src:
     file_dst.write("'"+line[0:len(line)-1]+"',")
file_dst.write("]")
file_src.close()
file_dst.close()
作者:jingshishengxu

图片内容