Re: How can I debug silent failure - print no output

2016-05-27 Thread Sayth Renshaw
> > > >Ok after printing a few things i have found an error. > > > >def GetArgs(): > >'''parse XML from command line''' > >parser = argparse.ArgumentParser() > > > >parser.add_argument("path", nargs="+") > >parser.add_argument('-e', '--extension', default='', > >

Re: How can I debug silent failure - print no output

2016-05-27 Thread cs
On 27May2016 21:02, Sayth Renshaw wrote: On Saturday, 28 May 2016 13:06:59 UTC+10, Michael Torrie wrote: Add more print() calls. Offhand I'd say that pq(filename=filename) is returning an empty list so that for loop is not doing anything. Hence your debugging print() calls never happen. Add

Coding systems are political (was Exended ASCII and code pages)

2016-05-27 Thread Rustom Mody
On Friday, May 27, 2016 at 9:39:19 PM UTC+5:30, Random832 wrote: > On Fri, May 27, 2016, at 11:53, Rustom Mody wrote: > > And coding systems are VERY political. > > Sure what characters are put in (and not) is political > > But more invisible but equally political is the collating order. > > > > e

Re: Exended ASCII and code pages [was Re: for / while else doesn't make sense]

2016-05-27 Thread Rustom Mody
On Saturday, May 28, 2016 at 12:34:14 AM UTC+5:30, Marko Rauhamaa wrote: > Random832 : > > > On Fri, May 27, 2016, at 05:56, Steven D'Aprano wrote: > >> On Fri, 27 May 2016 05:04 pm, Marko Rauhamaa wrote: > >> > They are all ASCII derivatives. Those that aren't don't exist. > >> *plonk* > > > > Th

Re: How can I debug silent failure - print no output

2016-05-27 Thread Sayth Renshaw
On Saturday, 28 May 2016 13:06:59 UTC+10, Michael Torrie wrote: > Add more print() calls. Offhand I'd say that pq(filename=filename) is > returning an empty list so that for loop is not doing anything. Hence > your debugging print() calls never happen. > > Add sanity print()'s earlier in your p

Re: How can I debug silent failure - print no output

2016-05-27 Thread Jason Friedman
> > def GetArgs(): > '''parse XML from command line''' > parser = argparse.ArgumentParser() > > parser.add_argument("path", nargs="+") > parser.add_argument('-e', '--extension', default='', > help='File extension to filter by.') > args = parser.parse_args

Re: How can I debug silent failure - print no output

2016-05-27 Thread Michael Torrie
On 05/27/2016 08:41 PM, Sayth Renshaw wrote: > This is my terminal and directory structure. Add more print() calls. Offhand I'd say that pq(filename=filename) is returning an empty list so that for loop is not doing anything. Hence your debugging print() calls never happen. Add sanity print()'s

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-27 Thread Michael Torrie
On 05/27/2016 08:09 PM, Michael Torrie wrote: > On 05/27/2016 08:41 AM, Sean Son wrote: >> Thank you for your reply. So the error isnt due to a bug in function >> itself? It is due to a possible error in the Android APK file? If that >> is the case, it would take a while to figure this out. I trie

How can I debug silent failure - print no output

2016-05-27 Thread Sayth Renshaw
Afternoon I am looking for help with this excerpt of code. The issue is that it completes with no error and with other code in I can see it connects to postgres however it is not picking up or parsing file, also no error though so I am not sure of the exact problem. I use prints to try and se

[no subject]

2016-05-27 Thread Noah Fleiszig
Thank you -- Sent from Gmail Mobile -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-27 Thread Michael Torrie
On 05/27/2016 08:41 AM, Sean Son wrote: > Thank you for your reply. So the error isnt due to a bug in function > itself? It is due to a possible error in the Android APK file? If that > is the case, it would take a while to figure this out. I tried contacted > the author of the project but I have

Re: Format a timedelta object

2016-05-27 Thread Pete Forman
Steven D'Aprano writes: > On Thu, 26 May 2016 03:28 pm, Zachary Ware wrote: > >> On Thu, May 26, 2016 at 12:16 AM, Steven D'Aprano >> wrote: >>> I have a timedelta object, and I want to display it in a nice >>> human-readable format like 03:45:17 for "three hours, forty five minutes, >>> 17 seco

Re: Exended ASCII and code pages [was Re: for / while else doesn't make sense]

2016-05-27 Thread Marko Rauhamaa
Random832 : > On Fri, May 27, 2016, at 05:56, Steven D'Aprano wrote: >> On Fri, 27 May 2016 05:04 pm, Marko Rauhamaa wrote: >> > They are all ASCII derivatives. Those that aren't don't exist. >> *plonk* > > That's a bit harsh, Everybody has a right to plonk anybody -- and even declare it ceremoni

Re: Format a timedelta object

2016-05-27 Thread Zachary Ware
On Fri, May 27, 2016 at 11:21 AM, Steven D'Aprano wrote: > On Thu, 26 May 2016 03:28 pm, Zachary Ware wrote: >> On Thu, May 26, 2016 at 12:16 AM, Steven D'Aprano >> wrote: >>> I have a timedelta object, and I want to display it in a nice >>> human-readable format like 03:45:17 for "three hours, f

Re: Format a timedelta object

2016-05-27 Thread Steven D'Aprano
On Thu, 26 May 2016 03:28 pm, Zachary Ware wrote: > On Thu, May 26, 2016 at 12:16 AM, Steven D'Aprano > wrote: >> I have a timedelta object, and I want to display it in a nice >> human-readable format like 03:45:17 for "three hours, forty five minutes, >> 17 seconds". >> >> Is there a standard wa

Re: Exended ASCII and code pages [was Re: for / while else doesn't make sense]

2016-05-27 Thread Chris Angelico
On Sat, May 28, 2016 at 2:09 AM, Random832 wrote: > On Fri, May 27, 2016, at 11:53, Rustom Mody wrote: >> And coding systems are VERY political. >> Sure what characters are put in (and not) is political >> But more invisible but equally political is the collating order. >> >> eg No one understands

Re: Exended ASCII and code pages [was Re: for / while else doesn't make sense]

2016-05-27 Thread Random832
On Fri, May 27, 2016, at 11:53, Rustom Mody wrote: > And coding systems are VERY political. > Sure what characters are put in (and not) is political > But more invisible but equally political is the collating order. > > eg No one understands what jmf's gripes are... My guess is that a Euro > costs

Re: Exended ASCII and code pages [was Re: for / while else doesn't make sense]

2016-05-27 Thread Rustom Mody
On Friday, May 27, 2016 at 7:21:41 PM UTC+5:30, Random832 wrote: > On Fri, May 27, 2016, at 05:56, Steven D'Aprano wrote: > > On Fri, 27 May 2016 05:04 pm, Marko Rauhamaa wrote: > > > > > They are all ASCII derivatives. Those that aren't don't exist. > > > > *plonk* > > That's a bit harsh, consi

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-27 Thread Sean Son
Hello Thank you for your reply. So the error isnt due to a bug in function itself? It is due to a possible error in the Android APK file? If that is the case, it would take a while to figure this out. I tried contacted the author of the project but I have yet to hear back from him . Thanks On

Re: Handling exceptions with Py2 and Py3

2016-05-27 Thread Ben Finney
Random832 writes: > On Fri, May 27, 2016, at 09:18, Ben Finney wrote: > > try: > > short_routine() > > except ConnectionRefusedError as exc: > > handle_connection_refused(exc) > > except OSError as exc: > > if exc.errno == errno.ECONNREFUSED: > > ha

Re: Exended ASCII and code pages [was Re: for / while else doesn't make sense]

2016-05-27 Thread Random832
On Fri, May 27, 2016, at 05:56, Steven D'Aprano wrote: > On Fri, 27 May 2016 05:04 pm, Marko Rauhamaa wrote: > > > They are all ASCII derivatives. Those that aren't don't exist. > > *plonk* That's a bit harsh, considering that this argument started when you invented your own definition of "ASCII

Re: Handling exceptions with Py2 and Py3

2016-05-27 Thread Random832
On Fri, May 27, 2016, at 09:18, Ben Finney wrote: > try: > short_routine() > except ConnectionRefusedError as exc: > handle_connection_refused(exc) > except OSError as exc: > if exc.errno == errno.ECONNREFUSED: > handle_connection_refused(exc) But Co

Re: Handling exceptions with Py2 and Py3

2016-05-27 Thread Pavlos Parissis
On 27/05/2016 02:51 μμ, Steven D'Aprano wrote: > On Fri, 27 May 2016 10:24 pm, Pavlos Parissis wrote: > >> Hi, >> >> So, we have ConnectionRefusedError in Python3 but not in Python2. >> Six module doesn't provide a wrapper about this. >> >> What is most efficient way to handle this situation in a

Re: Handling exceptions with Py2 and Py3

2016-05-27 Thread Ben Finney
Pavlos Parissis writes: > So, we have ConnectionRefusedError in Python3 but not in Python2. > Six module doesn't provide a wrapper about this. There are many new exception types in Python 3 that inherit from OSError. They are designed to be more precise than disambiguuating the many reasons an O

Re: Handling exceptions with Py2 and Py3

2016-05-27 Thread Steven D'Aprano
On Fri, 27 May 2016 10:24 pm, Pavlos Parissis wrote: > Hi, > > So, we have ConnectionRefusedError in Python3 but not in Python2. > Six module doesn't provide a wrapper about this. > > What is most efficient way to handle this situation in a try-catch block? Um, could you give us a hint as to co

Handling exceptions with Py2 and Py3

2016-05-27 Thread Pavlos Parissis
Hi, So, we have ConnectionRefusedError in Python3 but not in Python2. Six module doesn't provide a wrapper about this. What is most efficient way to handle this situation in a try-catch block? Cheers, Pavlos signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mail

Re: Exended ASCII and code pages [was Re: for / while else doesn't make sense]

2016-05-27 Thread Steven D'Aprano
On Fri, 27 May 2016 05:04 pm, Marko Rauhamaa wrote: > They are all ASCII derivatives. Those that aren't don't exist. *plonk* -- Steven -- https://mail.python.org/mailman/listinfo/python-list

EuroPython 2016 Keynote: Naomi Ceder

2016-05-27 Thread M.-A. Lemburg
We are pleased to announce our fourth keynote speaker for EuroPython 2016: *** Naomi Ceder *** About Naomi Ceder - Naomi Ceder has been learning, teaching, using, and talking about Python since 2001. She is the author of the Quick Python Book, 2nd editi

Re: Exended ASCII and code pages [was Re: for / while else doesn't make sense]

2016-05-27 Thread Marko Rauhamaa
Steven D'Aprano : > I don't mind being corrected if I make a genuine mistake, in fact I > appreciate correction. But being corrected for something I already > acknowledged? That's just arguing for the sake of arguing. > [...] >> ASCII derivatives are in wide use in the Americas and Antarctica as >