comparison castclient.py @ 99:349d49bb69f4

Porting on python3
author Magnus Schieder <mschieder@intevation.de>
date Tue, 19 Jun 2018 15:07:56 +0200
parents aee742cdd604
children
comparison
equal deleted inserted replaced
98:b2f96072b8d7 99:349d49bb69f4
35 r = requests.post(url, data=data, files=files) 35 r = requests.post(url, data=data, files=files)
36 36
37 if r.status_code == 200: 37 if r.status_code == 200:
38 with open(outfilename, "wb") as f: 38 with open(outfilename, "wb") as f:
39 f.write(r.content) 39 f.write(r.content)
40 print "OK" 40 print("OK")
41 else: 41 else:
42 print "An error has occured" 42 print("An error has occured")
43 print r.status_code, r.headers 43 print((r.status_code, r.headers))
44 print r.text 44 print((r.text))
45 sys.exit(2) 45 sys.exit(2)
46 46
47 47
48 if __name__ == "__main__": 48 if __name__ == "__main__":
49 main() 49 main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)