On Sep 3, 6:31 pm, Uwe Schmitt <[EMAIL PROTECTED]> wrote:
> On 2 Sep., 18:55, Steven D'Aprano <[EMAIL PROTECTED]
>
>
>
> cybersource.com.au> wrote:
> > I find myself writing command line tools in Python where I wish to
> > include "verbose" output to stdout.
>
> > I start with a helper function:
>
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> On Tue, 02 Sep 2008 13:07:33 -0400, Joe Riopel wrote:
>
> > On Tue, Sep 2, 2008 at 12:55 PM, Steven D'Aprano
> > <[EMAIL PROTECTED]> wrote:
> >> Is there a better way of doing this than the way I am going about it?
> >
> > Would the logging module he
On Tue, 02 Sep 2008 13:07:33 -0400, Joe Riopel wrote:
> On Tue, Sep 2, 2008 at 12:55 PM, Steven D'Aprano
> <[EMAIL PROTECTED]> wrote:
>> Is there a better way of doing this than the way I am going about it?
>
> Would the logging module help, and just print the output to the stdout
> (or a file) i
2008/9/3 Hendrik van Rooyen <[EMAIL PROTECTED]>:
>
> Steven D'Aprano wrote:
>
>>Is there a better way of doing this than the way I am going about it?
>
> Not sure if its "better", but I would keep the messages in a table or dict and
> have different tables or dicts for different levels of verbosit
On 2 Sep., 18:55, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> I find myself writing command line tools in Python where I wish to
> include "verbose" output to stdout.
>
> I start with a helper function:
>
> def print_(obj, level=0):
> if _verbosity >= level:
> print
False
if (p & 4)==4:
print_debug = True
else:
print_debug = False
No, no, no, you've taken "How to write verbose scripts" rather too
literally;
KEYBOARD !
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
>Is there a better way of doing this than the way I am going about it?
Not sure if its "better", but I would keep the messages in a table or dict and
have different tables or dicts for different levels of verbosity, and write a
displayer that knows about the verbosity - T
; else:
> > print_evens = False
> > if (p & 2)==2:
> > print_odds = True
> > else:
> > print_odds = False
> > if (p & 4)==4:
> > print_debug = True
> > else:
> > print_debug = False
>
> No, no, no, you've tak
else:
> print_odds = False
> if (p & 4)==4:
> print_debug = True
> else:
> print_debug = False
No, no, no, you've taken "How to write verbose scripts" rather too
literally; try this:
print_evens = p & 1
print_odds = p & 2
print_debug = p & 4
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 2, 5:55 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> I find myself writing command line tools in Python where I wish to
> include "verbose" output to stdout.
>
> I start with a helper function:
>
> def print_(obj, level=0):
> if _verbosity >= level:
> print
Steven D'Aprano schrieb:
I find myself writing command line tools in Python where I wish to
include "verbose" output to stdout.
I start with a helper function:
def print_(obj, level=0):
if _verbosity >= level:
print obj
And then I end up with functions or methods looking like th
On Sep 2, 11:55 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> I find myself writing command line tools in Python where I wish to
> include "verbose" output to stdout.
>
> I start with a helper function:
>
> def print_(obj, level=0):
> if _verbosity >= level:
> prin
On Tue, Sep 2, 2008 at 12:55 PM, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Is there a better way of doing this than the way I am going about it?
Would the logging module help, and just print the output to the stdout
(or a file) instead?
--
http://mail.python.org/mailman/listinfo/python-list
I find myself writing command line tools in Python where I wish to
include "verbose" output to stdout.
I start with a helper function:
def print_(obj, level=0):
if _verbosity >= level:
print obj
And then I end up with functions or methods looking like this:
def parrot(x)
pri
14 matches
Mail list logo