Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import json
  2. import csv
  3.  
  4. json_file_name = input("Enter the name of the input file: ")
  5. csv_file_name = input("Enter the name of the output file: ")
  6.  
  7. try:
  8.     with open(json_file_name) as json_file:
  9.         data = json.load(json_file)
  10.  
  11.         for dicti in data:
  12.             row = [dicti["stationId"], dicti["name"]]
  13.  
  14. except IOError:
  15.     print("\nThere was an error in handling the file.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement