Logging all uncaught exceptions

2014-07-13 Thread Steven D'Aprano
I want to catch all uncaught exceptions in my application, log them, then handle as normal. Which, in practice, means a traceback. Is this the right way to do it? import logging import sys logger = logging.getLogger('mylogger') def my_handler(type, value, tb): msg = "Uncaught %s: %s" % (

Re: Multiprocessing question

2014-07-13 Thread Marko Rauhamaa
Gary Herron : > On 07/13/2014 04:53 PM, Paul LaFollette wrote: >> I have thrown together a little C/UNIX program that forks a child >> process, then proceeds to let the child and parent alternate. Either >> can run until it pauses itself and wakes the other. >> >> [...] > > What do you gain from u

Re: Twitter Client on Terminal by Python

2014-07-13 Thread Orakaro
On Monday, July 14, 2014 12:51:29 PM UTC+9, Chris Angelico wrote: > On Mon, Jul 14, 2014 at 12:18 PM, Orakaro wrote: > > > I use README.md for Github and README.rst for PyPi. Is there a way to use > > only one file for both sites ? > > > > Ah. I don't know; check the docs for one or the other

Re: Twitter Client on Terminal by Python

2014-07-13 Thread Chris Angelico
On Mon, Jul 14, 2014 at 12:18 PM, Orakaro wrote: > I use README.md for Github and README.rst for PyPi. Is there a way to use > only one file for both sites ? Ah. I don't know; check the docs for one or the other and see what they'll do. > I tested my package on Python 2.7 and Python 3.4 But do

Re: Multiprocessing question

2014-07-13 Thread Steven D'Aprano
On Sun, 13 Jul 2014 19:53:09 -0400, Paul LaFollette wrote: > I have thrown together a little C/UNIX program that forks a child > process, then proceeds to let the child and parent alternate. Either > can run until it pauses itself and wakes the other. > > I would like to know if there be a way t

Re: Twitter Client on Terminal by Python

2014-07-13 Thread Orakaro
On Monday, July 14, 2014 3:20:43 AM UTC+9, Chris Angelico wrote: > On Mon, Jul 14, 2014 at 4:00 AM, Orakaro wrote: > > > Thanks for any feedback and sorry if this kind of topics is not tolerated > > here. > > > > No no, announcements of this sort are perfectly welcome here! > > > > I notic

Re: What Next After Python Basics

2014-07-13 Thread C.D. Reimer
On 7/13/2014 1:16 PM, Orochi wrote: Hi, I am beginner in Python I have Completed Basic Python Course from Codecademy.com . Now that I have a hands on the basics what is the next thing I should do. I mean should I learn more or start a small Project(Any Ideas are Welcomed) or any Other suggestion

Re: What Next After Python Basics

2014-07-13 Thread Dan Stromberg
On Sun, Jul 13, 2014 at 1:16 PM, Orochi wrote: > Hi, > I am beginner in Python > I have Completed Basic Python Course from Codecademy.com . > Now that I have a hands on the basics what is the next thing I should do. > I mean should I learn more or start a small Project(Any Ideas are Welcomed) > o

Re: Multiprocessing question

2014-07-13 Thread Gary Herron
On 07/13/2014 04:53 PM, Paul LaFollette wrote: Kind people, I have thrown together a little C/UNIX program that forks a child process, then proceeds to let the child and parent alternate. Either can run until it pauses itself and wakes the other. I would like to know if there be a way to cre

Re: Newbie: unexpected indenting error

2014-07-13 Thread Denis McMahon
On Sun, 13 Jul 2014 09:01:12 +0200, Martin S wrote: > While coding a rating calculator I am using a for-loop within > if-elif-else. > When using the for-loop in the first if instance my editor accepts this, > but when using the same for-loop within the elif instance it complain > about "unexpected

Multiprocessing question

2014-07-13 Thread Paul LaFollette
Kind people, I have thrown together a little C/UNIX program that forks a child process, then proceeds to let the child and parent alternate. Either can run until it pauses itself and wakes the other. I would like to know if there be a way to create the same behavior in Python 3, preferably in a n

Re: codingbat question broken?

2014-07-13 Thread Orochi
On Sunday, 13 July 2014 07:49:18 UTC+5:30, Chris Angelico wrote: > On Sun, Jul 13, 2014 at 12:05 PM, Rodrick Brown > wrote: > > > > > > Can anyone show me an example where all test are success? > > > > No, because that's asking for the answer :) What you need to do is > > look at the faili

What Next After Python Basics

2014-07-13 Thread Orochi
Hi, I am beginner in Python I have Completed Basic Python Course from Codecademy.com . Now that I have a hands on the basics what is the next thing I should do. I mean should I learn more or start a small Project(Any Ideas are Welcomed) or any Other suggestions. Where to Start? Thank You, Orochi

Re: Twitter Client on Terminal by Python

2014-07-13 Thread Chris Angelico
On Mon, Jul 14, 2014 at 4:00 AM, Orakaro wrote: > Thanks for any feedback and sorry if this kind of topics is not tolerated > here. No no, announcements of this sort are perfectly welcome here! I notice you have both README.md and README.rst - is there a reason for that? What Python versions d

Twitter Client on Terminal by Python

2014-07-13 Thread Orakaro
Hello! I'm @dtvd88 on Twitter and very new here. I read from python.org that anything Python-related can be discussed, and not sure if I can share my OSS package here to get feedback or not ? I just wrote a Twitter Client on Terminal by Python, it has very beautiful display and even can display

Re: Newbie: unexpected indenting error

2014-07-13 Thread Martin S
Thanks, the problem was apparently a mix of way to indent the code. It's confused the H out of the editor. Using standard indentation solved the error. 2014-07-13 9:28 GMT+02:00 Gary Herron : > On 07/13/2014 12:01 AM, Martin S wrote: >> >> While coding a rating calculator I am using a for-loop wit

Re: Newbie: unexpected indenting error

2014-07-13 Thread Mark Lawrence
On 13/07/2014 08:01, Martin S wrote: While coding a rating calculator I am using a for-loop within if-elif-else. When using the for-loop in the first if instance my editor accepts this, but when using the same for-loop within the elif instance it complain about "unexpected indent". Like so: def

Re: Newbie: unexpected indenting error

2014-07-13 Thread Ben Finney
Martin S writes: > What the...? What am I doing wrong? > (hopefully the indents translate; else def, if/elif, for and [dostuff] > are indented) They're all indented by different amounts. I don't see anything that would cause the parser to tell you “unexpected indent”, though. For those reasons

Newbie: unexpected indenting error

2014-07-13 Thread Martin S
While coding a rating calculator I am using a for-loop within if-elif-else. When using the for-loop in the first if instance my editor accepts this, but when using the same for-loop within the elif instance it complain about "unexpected indent". Like so: def function(x): if rdiff >=500: