It is apples vs. oranges comparison: JSON is a data format (a string), Python dictionary is a data structure (in-memory object).
If you need to exchange data between different (perhaps even non-Python) processes then you could use JSON format to serialize your Python dictionary.
The text representation of a dictionary looks like (but it is not) json format:
>>> print(dict(zip('abc', range(3))))
{'a': 0, 'b': 1, 'c': 2}
Text representation (a string) of an object is not the object itself (even string objects and their text representations are different things e.g., "\n" is a single newline character but obviously its text representation is several characters).
Çok teknik anlatmışsınız. Bu dediklerinizi bilmiyorum. Daha basite indirgeyebilir misiniz?'dumps' method'u object'i JSON'a cevirir. Ornegin bi HTTP Post request olusturacaksaniz Body'sini bu sekilde doldurabilirsiniz. Aralarindaki farka gelcek olursak:
In Python, why should one use JSON scheme instead of a dictionary?
(This is an edit of the original question) "What's the difference between Python Dictionary and JSON?" "needed clarity" although for me it is very clear and logical! Anyway, her...stackoverflow.com
Bu sitenin çalışmasını sağlamak için gerekli çerezleri ve deneyiminizi iyileştirmek için isteğe bağlı çerezleri kullanıyoruz.