当前位置: 移动技术网 > IT编程>脚本编程>Python > 将关键词列表文件转成python的list

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

2019年04月05日  | 移动技术网IT编程  | 我要评论

云南省优秀企业家 甘健邑,福田汽车怎么样,爱情魔戒演员表

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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网