Шлюз и Микросервис не подключаются к Реестру после включения профиля oauth2

Мой простой способ решить эту проблему:

Создайте новый файл Python, например: json_to_csv.py

Добавьте этот код:

import csv, json, sys
#if you are not using utf-8 files, remove the next line
sys.setdefaultencoding("UTF-8")
#check if you pass the input file and output file
if sys.argv[1] is not None and sys.argv[2] is not None:

    fileInput = sys.argv[1]
    fileOutput = sys.argv[2]

    inputFile = open(fileInput)
    outputFile = open(fileOutput, 'w')
    data = json.load(inputFile)
    inputFile.close()

    output = csv.writer(outputFile)

    output.writerow(data[0].keys())  # header row

    for row in data:
        output.writerow(row.values())

После добавления этот код, сохраните файл и запустите на терминале:

python json_to_csv.py input.txt output.csv

Надеюсь, это поможет вам.

SEEYA!

0
задан Nik 29 March 2019 в 11:55
поделиться