Process Text Files with Python Dictionaries and Upload to Running Web Service || Google || Coursera

preview_player
Показать описание
The source code is available below the first comment.....
Рекомендации по теме
Комментарии
Автор

#! /usr/bin/env python3
import os
import requests

# path to the data
BASEPATH = "/data/feedback/"

folder = os.listdir(BASEPATH)
list = []
for file in folder:
with open(BASEPATH + file, 'r') as f:
list.append({"title":f.readline().rstrip("\n"),
"name":f.readline().rstrip("\n"),
"date":f.readline().rstrip("\n"),

for item in list:
if response.status_code !=201:
raise Exception('POST error
print('Created feedback ID:

waheedtech
welcome to shbcf.ru