Re: self question

2006-07-25 Thread dan . gass
> cnt = 1 > def foo(): > global cnt > cnt += 1 > return cnt > > def bar(x=foo()): > print x > > bar() # 2 > bar() # 2 > bar() # 2 Looks to me like you want to use the following programming pattern to get dynamic default arguments: cnt = 1 def foo(): global cnt

Re: An optparse question

2006-07-21 Thread dan . gass
> Nope. That only *nearly* does what T wants. The usage message will > still be printed immediately *after* the 'usage: ' string. > > >>> parser = OptionParser(usage=usage) > >>> parser.print_help() > usage: THIS IS NEWLY INSERTED STRING > usage: lopts.py [options] input

Re: An optparse question

2006-07-21 Thread dan . gass
> No, that affects the string printed only *after* the "usage = " string. > What I would like to do is insert some string *before* the "usage = " > string, which is right after the command I type at the command prompt. > So I would like to make it look like this: The example was fine (except for

Re: Which is More Efficient?

2006-05-18 Thread dan . gass
Measure it and find out. Sounds like a little investment in your time learning how to measure performance may pay dividends for you. -- http://mail.python.org/mailman/listinfo/python-list

Re: using breakpoints in a normal interactive session

2006-02-23 Thread dan . gass
Carl -- Perfect! That is exactly what I want. I hoped it would be that easy. Thanks for taking the time to post the solution. -- http://mail.python.org/mailman/listinfo/python-list

using breakpoints in a normal interactive session

2006-02-22 Thread dan . gass
Is there a way to temporarily halt execution of a script (without using a debugger) and have it put you in an interactive session where you have access to the locals? And possibly resume? For example: >>> def a(): ... x = 1 ... magic_breakpoint() ... y = 1 ... print "got here" ... >>> a(

Re: Making mouse wheel work with pmw ScrolledCanvas widget

2006-02-19 Thread dan . gass
This looks like it has nothing to do with Pmw (Mega widgets) but is really a basic Tkinter problem. -- http://mail.python.org/mailman/listinfo/python-list

Making mouse wheel work with pmw ScrolledCanvas widget

2006-02-18 Thread dan . gass
Thanks in advance, Dan Gass -- http://mail.python.org/mailman/listinfo/python-list

[Python-Announce] cfgparse v01_01 released

2005-03-23 Thread Dan Gass
enabled by default. + May be extended to support syntax such as XML. Enjoy, Dan Gass -- http://mail.python.org/mailman/listinfo/python-list

Re: wanted: C++ parser written in Python

2005-02-25 Thread dan . gass
rsion, but the area that you would be looking at is not changing so I would go ahead and download the latest that is there. TestGen can be found at sourceforge.net/projects/testgen Regards, Dan Gass -- http://mail.python.org/mailman/listinfo/python-list

Re: cfgparse v01_00 released

2005-02-01 Thread dan . gass
reciated. I've spent a fair amount of time implementing and testing features that I don't really use in order to be able to contribute this to the Python community. If you would like to see it (or see specific features it has) in the standard library I encourage you to make comments at http://www.python.org/moin/ConfigParserShootout Regards, Dan Gass -- http://mail.python.org/mailman/listinfo/python-list

[Python-Announce] cfgparse v01_00 released

2005-01-30 Thread Dan Gass
Enjoy, Dan Gass -- http://mail.python.org/mailman/listinfo/python-list

ANN: TestGen 0.05 C/C++ Test Generator Released

2004-11-29 Thread Dan Gass
TestGen 0.05 is now available and contains significant enhancements. What's New -- Significant Enhancements/Changes 1) added manipc.py, a generic C/C++ source manipulator that can be used for function/method isolation and stubbing for the purposes of unit testing with any test frame