Python'da Json İle Dictionary Farkı

'dumps' method'u object'i JSON'a cevirir. Ornegin bi HTTP Post request olusturacaksaniz Body'sini bu sekilde doldurabilirsiniz. Aralarindaki farka gelcek olursak:
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).

 
'dumps' method'u object'i JSON'a cevirir. Ornegin bi HTTP Post request olusturacaksaniz Body'sini bu sekilde doldurabilirsiniz. Aralarindaki farka gelcek olursak:


Çok teknik anlatmışsınız. :) Bu dediklerinizi bilmiyorum. Daha basite indirgeyebilir misiniz?
 
Uyarı! Bu konu 6 yıl önce açıldı.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.

Yeni konular

Geri
Yukarı