About 403,000 results
Open links in new tab
  1. How can I parse (read) and use JSON in Python? - Stack Overflow

    My Python program receives JSON data, and I need to get bits of information out of it. How can I parse the data and use the result? I think I need to use json.loads for this task, but I can't under...

  2. python - How do I write JSON data to a file? - Stack Overflow

    How do I write JSON data stored in the dictionary data to a file? f = open ('data.json', 'wb') f.write (data) This gives the error: TypeError: must be string or buffer, not dict

  3. python - What's the best way to parse a JSON response from the …

    Mar 24, 2020 · 430 I'm using the python requests module to send a RESTful GET to a server, for which I get a response in JSON. The JSON response is basically just a list of lists. What's the …

  4. python - How to dynamically build a JSON object? - Stack Overflow

    json.dumps take a dictionary as input and returns a string as output. If you need to convert JSON data into a python object, it can do so with Python3, in one line without additional installations, …

  5. json - How would you save a simple settings/configuration file in ...

    Oct 27, 2024 · 282 Configuration files in Python There are several ways to do this depending on the file format required. ConfigParser [.ini format] I would use the standard configparser …

  6. Add variable value in a JSON string in Python - Stack Overflow

    21 I am puzzled why this is not working. I am trying add my variable value in the JSON and everytime I add it, it is not showing properly in my JSON string.

  7. How to get JSON from webpage into Python script

    Unfortunately, that doesn't work in Python 3. json.load is just a wrapper around json.loads that calls read () for a file-like object. json.loads requires a string object and the output of …

  8. python - How to prettyprint a JSON file? - Stack Overflow

    For simple pretty printing is ok, but if you want to manipulate the json it can become overcomplicated. You'd soon need to write a separate script-file, you could end up with maps …

  9. HTTP requests and JSON parsing in Python - Stack Overflow

    Jun 17, 2011 · 178 The requests Python module takes care of both retrieving JSON data and decoding it, due to its builtin JSON decoder. Here is an example taken from the module's …

  10. Getting values from JSON using Python - Stack Overflow

    If you want to get values from a JSON document, then open the file first and pass the file handle to json.load() instead. Depending on the document structure, json.load() would return …