M
M
Maxim Siomin2020-06-17 16:30:09
Python
Maxim Siomin, 2020-06-17 16:30:09

What is the format of json files and how to upload them?

For example, this code:

import json

dict = {
    'hello': 'world'
    'pubg':'best_game'
}

with open ('saves.какой формат тут надо указать') as file:
    json.dump(#нужны ли кавычки перед и после dict? dict)
#с dumps мне все понятно
with open('saves.какой формат тут надо указать') as file:
    json.loads(#тут тоже не очень понял, выгружать надо под именем которое было указано в dump, и нужно ли ставить кавычки? dict)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-06-17
@MaxSiominDev

The format doesn't matter, a file is a file. Usually .json put
What kind of quotes?
json.dump(dict, file)
dict = json.load(file)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question