“JSON -Datei” Code-Antworten

Lesen Sie die JSON -Datei

# Python program to read JSON
# from a file
  
  
import json
  
# Opening JSON file
with open('sample.json', 'r') as openfile:
  
    # Reading from json file
    json_object = json.load(openfile)
  
print(json_object)
print(type(json_object))
Troubled Turkey

Lesen Sie den JSON aus einer JSON -Datei

import json
with open("sample_data.json", "r") as file:
    data = json.load(read_file)
    print(data)
Impossible Impala

JSON -Datei

{
"nyelvek":[
  {"nev":"HTML", "kiterjesztes":".html"},
  {"nev":"CSS", "kiterjesztes":".css"},
  {"nev":"JavaScript", "kiterjesztes":".js"}
]
}
Code language: JSON / JSON with Comments (json)
Horrible Hamster

# Lesen Sie die JSON -Datei und drucken Sie den Dateiinhalt im JSON -Format.

# read the JSON file and also print the file content in JSON format.
with open(filename, 'r') as f:
  d = json.load(f)
  print(json.dumps(d, indent=2))
  
Impossible Impala

Ähnliche Antworten wie “JSON -Datei”

Fragen ähnlich wie “JSON -Datei”

Weitere verwandte Antworten zu “JSON -Datei” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen