Re: Switching between Python releases under Windows

2011-03-13 Thread Tim Lesher
I've written a script to do just this, called switchpy.bat. It's described here: http://apipes.blogspot.com/2010/10/switchpy.html Or you can just grab the latest version at: https://bitbucket.org/tlesher/mpath/src/3edcff0e8197/switchpy.bat -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get bit info

2010-06-17 Thread Tim Lesher
On Jun 17, 3:51 pm, Back9 wrote: > Hi, > > I have one byte data and want to know each bit info, > I mean how I can know each bit is set or not? You want the bitwise-and operator, &. For example, to check the least significant bit, bitwise-and with 1: >>> 3 & 1 1 >>> 2 & 1 0 -- http://mail.pyth

Re: Regarding coding style

2008-03-18 Thread Tim Lesher
lly expects. > > Like doctests? (I know, smart-ass response) > > Regards, > Ryan Ginstrom Not a smart-ass response at all--a _smart_ response. Doctests are one of the few mechanisms I've ever seen that even attempt to make this happen. -- Tim Lesher [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how can i profile every line of code

2008-02-21 Thread Tim Lesher
On Feb 21, 3:27 pm, Tim Lesher <[EMAIL PROTECTED]> wrote: > On Feb 21, 10:06 am, scsoce <[EMAIL PROTECTED]> wrote: > > > I want to profile a function which has some lines of statement. It seem > > that profile module only report function's stats instead of

Re: how can i profile every line of code

2008-02-21 Thread Tim Lesher
On Feb 21, 10:06 am, scsoce <[EMAIL PROTECTED]> wrote: > I want to profile a function which has some lines of statement. It seem > that profile module only report function's stats instead of every line > of code, how can i profile every line of code? > thanks. Use the hotshot profiler, and when c

Re: Iterating over marshal

2006-10-06 Thread Tim Lesher
On Oct 6, 4:19 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Tim Lesher wrote: > > I'm using the marshal library to unmarshal a file containing one or > > more objects. The canonical way seems to be: > > > objs = [] > > while 1: > >

Iterating over marshal

2006-10-06 Thread Tim Lesher
al library has been around since roughly forever, is it just that no one's bothered to add iteration support to it, or am I missing something? Thanks. -- Tim Lesher [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem of function calls from map()

2006-08-21 Thread Tim Lesher
Dasn wrote: > So how to put '\t' argument to split() in map() ? How much is the lambda costing you, according to your profiler? Anyway, what you really want is a list comprehension: l = [line.split('\t') for line in lines] -- http://mail.python.org/mailman/listinfo/python-list

Re: What is your favorite Python web framework?

2005-07-24 Thread Tim Lesher
development--a new version just came out a few weeks ago (so it's not going away). The main reason I switched was the Spyce templating engine--more powerful than CherryTemplate, and tons more readable than Cheetah, in my opinion. -- Tim Lesher [EMAIL PROTECTED] http://apipes.bl

Re: PyGTK or wxPython (not a flame war) on Windows

2005-07-24 Thread Tim Lesher
Yes, it's not that hard to get the native file dialogs, as described in the FAQ: http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq21.013.htp It would be nice if PyGTK had a knob for making it use win32 dialogs by default, though. -- http://mail.python.org/mailman/listinfo/python-list

Re: what's wrong with my code using subprocess?

2005-07-24 Thread Tim Lesher
I see the same behavior as you do. On Windows, the wait() isn't hanging--what's happening is that the subprocess just never receives anything. I don't quite understand why, but it works fine when I change the "if" clause in receiver.py to this: if count >= 1000: p.communicate('exit')

python-dev Summary for 2005-04-01 through 2005-04-15

2005-04-20 Thread Tim Lesher
by the team of Steve Bethard, Tim Lesher, and Tony Meyer. We're trying a collaborative approach to the summaries: each fortnight, we'll be getting together in a virtual smoke-filled back room to divide up the interesting threads. Then we'll stitch together the summaries in roughly t

Status of Chaco?

2005-04-04 Thread Tim Lesher
ave it released within > the next few weeks. Is Chaco dead? Or just pining? -- Tim Lesher <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list