M
M
Maxim Siomin2020-12-05 21:02:51
Python
Maxim Siomin, 2020-12-05 21:02:51

json error in python?

import json
with open('first.json') as file:
    json.dump("hello", file)

Traceback (most recent call last):
  File "C:\Users\Maxim\OneDrive\Рабочий стол\Wallpapers\test.py", line 3, in <module>
    json.dump("hello", file)
  File "C:\Program Files (x86)\Python37-32\lib\json\__init__.py", line 180, in dump
    fp.write(chunk)
io.UnsupportedOperation: not writable

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-12-05
@MaxSiominDev

with open('first.json', 'w' )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question