Re: Python Error message

2016-08-05 Thread dieter
GBANE FETIGUE writes: > ... > I am running a python script to run some CURL commands, and return the > response which is the applicationId and the versionId. I was able to do it. > Now the versionId value supposed to be used on the second CURL as a value of > the applications key which is an ar

Re: Python Error message

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 5:36 AM, Terry Reedy wrote: > An example of the latter is when one writes code in Python to execute > 'other' code. (IDLE is one example. It both executes user statements and > evals user expressions.) One needs "except BaseException:" to isolate the > interpreter from e

Re: Python Error message

2016-08-04 Thread Terry Reedy
On 8/4/2016 12:19 PM, MRAB wrote: In those rare occasions when you do write a bare except, A bare "except:" is never needed and in my opinion, and that of others, one should never write one (except possibly for experimentation). Be explicit and write "except BaseException:" or "except Except

Re: Python Error message

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 2:09 AM, Igor Korot wrote: >> [1] There are exceptions to this rule, for experts. But if you need to ask >> what they are, you're not ready to know > > But even the experts will never write such a code - you never know what > happens > in a month. Server might throw some ne

Re: Python Error message

2016-08-04 Thread MRAB
On 2016-08-04 17:09, Igor Korot wrote: Steven, On Thu, Aug 4, 2016 at 11:56 AM, Steven D'Aprano wrote: On Fri, 5 Aug 2016 01:31 am, GBANE FETIGUE wrote: try: parsed_response = json.loads(response) deployid = parsed_response[u'id'] print "Your deployid is: " + deployid except: prin

Re: Python Error message

2016-08-04 Thread MRAB
On 2016-08-04 16:31, GBANE FETIGUE wrote: Hi, I am running a python script to run some CURL commands, and return the response which is the applicationId and the versionId. I was able to do it. Now the versionId value supposed to be used on the second CURL as a value of the applications key whi

Re: Python Error message

2016-08-04 Thread Igor Korot
Steven, On Thu, Aug 4, 2016 at 11:56 AM, Steven D'Aprano wrote: > On Fri, 5 Aug 2016 01:31 am, GBANE FETIGUE wrote: > >> try: >> parsed_response = json.loads(response) >> deployid = parsed_response[u'id'] >> print "Your deployid is: " + deployid >> except: >> print 'Seems the named id

Re: Python Error message

2016-08-04 Thread Steven D'Aprano
On Fri, 5 Aug 2016 01:31 am, GBANE FETIGUE wrote: > try: > parsed_response = json.loads(response) > deployid = parsed_response[u'id'] > print "Your deployid is: " + deployid > except: > print 'Seems the named id already exists!' I'm not going to try to debug your code blindfolded wit

Re: Python Error message

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 1:31 AM, GBANE FETIGUE wrote: > try: > parsed_response = json.loads(response) > print "Your applicationId is: " + parsed_response[u'applicationId'] > version_id = parsed_response[u'versionId'] > print "Your versionId is: " + version_id > except: > print '