Skip to content

Instantly share code, notes, and snippets.

@crearo
Created April 17, 2016 19:54
Show Gist options
  • Save crearo/a2ad07cf499cdabc5901e1db648746b6 to your computer and use it in GitHub Desktop.
Save crearo/a2ad07cf499cdabc5901e1db648746b6 to your computer and use it in GitHub Desktop.
lines = tuple(open("Books", "r"))
for line in lines:
print line.split(';')[0]
count = 0
for item in finalitems:
print '{"ISBN":"' + item[0] + '",'+ '"place":"' + item[2] + '","accesionNumber":"' + item[1] + '"}'
count += 1
if count >= 400 :
item[0] = str(item[0])
data={"ISBN": item[0], "accessionNumber": item[1], "place": item[2]}
print data
r = requests.post("localhost/url", data=data)
print(r.status_code, r.reason)
print(r.text[:300] + '...')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment