```
def save_csv(m,n):
CSV = open(m,"w")
t = ""
for i in range(len(n)):
t += str(n[i]) + "列表分隔处"
t = t.replace(",","此处为原来的逗号")
x = list(filter(None,t.split("列表分隔处")))
CSV.write(",".join(x))
CSV.close()
def open_csv(m):
file = open(m,"r").read()
file = file.replace(",","从此处分割")
file = file.replace("此处为原来的逗号",",")
new_list = file.split("从此处分割")
print("解析出的列表为{}".format(new_list))
def main():
n = input("请输入列表元素,以分好分割:")
m = input("请输入要保存的csv文件名:")
n = n.split(";")
print("输入的列表为{}".format(n))
save_csv(m,n)
open_csv(m)
main()
```
```
file = open("777.csv","r").read()
file = file.replace(",","从此处分割")
print(file)
file = file.replace("此处为原来的逗号",",")
print(file)
new_list = file.split("从此处分割")
print(new_list)
print(type("解析出的列表为{}".format(new_list)))
```
- py转exe
- py服务器
- py登录
- py查询
- 爬TB热卖1017
- 爬TB分类1015
- 爬BD文库1010
- 爬文库924
- json917
- decode912
- 转码910
- radians829
- turtle827
- 画叶子820
- 树干815
- Turtle, mainloop718
- sorted716
- random711
- turtle.colormode709
- abs704
- begin_fill702
- randint,random627
- isalpha625
- keyword620
- compile618
- judge613
- list1.copy611
- random.choice606
- format_randint604
- save_csv528
- jieba523
- wordcloud521
- wordcloud516
- jieba.lcut514
- counts503
- format423
- 花瓣418
- strftime416
- turtle.fillcolor411
- random.random409
- pensize404
- 花蕊328
- input327
- eval_float320
- open319
- while314
- JCR影响因子313
- _to_chinese4_312
- encoding306
- read305
- flask1029