我如何追加文件格式的列表?

时间:2019-06-11 01:56:54

标签: python-3.x

我正在尝试在存在json formate的文本文件中附加一个列表。但我无法附加它。你能帮我...吗?

p=open(r"phbook.txt","at")
l=p.readline().split(",")

输出:

Traceback (most recent call last):
  File "E:/pyt train/my1/phyton-training/file handelling/phone book save.py", line 2, in <module>
    l=p.readline().split(",")
io.UnsupportedOperation: not readable

0 个答案:

没有答案