What is the difference between json.load() and json.loads() functions

前端 未结 6 761
天涯浪人
天涯浪人 2020-11-29 16:36

In Python, what is the difference between json.load() and json.loads()?

I guess that the load() function must be used with a file

6条回答
  •  [愿得一人]
    2020-11-29 16:52

    Yes, s stands for string. The json.loads function does not take the file path, but the file contents as a string. Look at the documentation at https://docs.python.org/2/library/json.html!

提交回复
热议问题