import json
      
      if os.path.isfile(filename):
        with open(filename) as myfile:
          file_content = myfile.read()
          try:
            json_content = json.loads(file_content)
          except json.decoder.JSONDecodeError:
            # Cannot read the file
            json_content = None
      
      Python language logo

      Read JSON file

      json
      Python public recipes

      Read JSON file and store it as a dictionary

      Shortcut: json.file.read

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.