_PyLong_FromByteArray

2006-08-12 Thread Dan Christensen
My student and I are writing a C extension that produces a large integer in binary which we'd like to convert to a python long. The number of bits can be a lot more than 32 or even 64. My student found the function _PyLong_FromByteArray in longobject.h which is exactly what we need, but the leadi

Re: numeric/numpy/numarray

2006-06-13 Thread Dan Christensen
Bryan <[EMAIL PROTECTED]> writes: > on the python wiki > "NumArray is the current reimplementation of NumPy." > http://wiki.python.org/moin/NumArray > > so, was Numarray written *before* NumPY, or was it a reimplementation of > NumPy > which implies it came *after* NumPy? I clarified that wiki

Re: list.clear() missing?!?

2006-04-12 Thread Dan Christensen
Raymond Hettinger <[EMAIL PROTECTED]> writes: > Felipe Almeida Lessa writes: > > > I love benchmarks, so as I was testing the options, I saw something very > > strange: > > > > $ python2.4 -mtimeit 'x = range(10); ' > > 100 loops, best of 3: 6.7 msec per loop > > $ python2.4 -mtimeit 'x = ran

Re: list.clear() missing?!?

2006-04-11 Thread Dan Christensen
Felipe Almeida Lessa <[EMAIL PROTECTED]> writes: > I love benchmarks, so as I was testing the options, I saw something very > strange: > > $ python2.4 -mtimeit 'x = range(10); ' > 100 loops, best of 3: 6.7 msec per loop > $ python2.4 -mtimeit 'x = range(10); del x[:]' > 100 loops, best of

Re: timeit module: am I missing something obvious?

2006-02-20 Thread Dan Christensen
Peter Otten <[EMAIL PROTECTED]> writes: > Steven D'Aprano wrote: > >> When using the timeit module, you pass the code you >> want to time as strings: ... >> This is all very well, but it feels quite unnatural to >> me. Why am I passing strings around when functions are >> first class objects? Have

Re: Recursive Property of Octal Numbers

2005-10-01 Thread Dan Christensen
James Stroud <[EMAIL PROTECTED]> writes: > I'm very curious about what is going on here. I'm sure my curiosity has > something to do with ignorance of some fundamental concept of computer > science (maybe that 8 is just a vertical infinity?): > > py> b = '\xb6' > py> b[0] > '\xb6' > py> b[0][0]

Re: What language to manipulate text files

2005-06-12 Thread Dan Christensen
ross <[EMAIL PROTECTED]> writes: > What are the ideal languages for the following examples? > > 1. Starting from a certain folder, look in the subfolders for all > filenames matching *FOOD*.txt Any files matching in each folder should > be copied to a new subfolder within the current folder called

Re: Information about Python Codyng Projects Ideas

2005-06-01 Thread Dan Christensen
M1st0 <[EMAIL PROTECTED]> writes: > I would like to join the Google summer code program > (http://code.google.com/summerofcode.html). > From the sponsored links I have choose to help The Python Software > Foundation, because I like a lot the language. I've always thought it'd be great if psyco wa

Re: Representing ambiguity in datetime?

2005-05-18 Thread Dan Christensen
Ron Adam <[EMAIL PROTECTED]> writes: > So it seems using 0's for the missing day or month may be how to do it. This doesn't allow more specific amounts of ambiguity. I suggest either a pair of dates, which represent the earliest and latest that the event could have been (and are equal if there i

Re: pyvm -- faster python

2005-05-09 Thread Dan Christensen
djw <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: >> Stelios Xanthakis <[EMAIL PROTECTED]> writes: >> >>>- The demo is an x86/linux binary only. You shouldn't trust binaries, >>> run it in a chrooted environment not as root! >> >> >> Are you going to release the source? If not, it's a lot

Re: global lists

2005-05-09 Thread Dan Christensen
andrea crotti <[EMAIL PROTECTED]> writes: > Hi everbybody again, > I have a little "problem", I don't understand the reason of this: > > a = [10,1,2,3] > def foo(): > global a > for n in range(len(a)): > a[n] = a[n]*2 If I type the above, and then call foo, I get what looks like reasonabl

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Dan Christensen
Tim Peters <[EMAIL PROTECTED]> writes: > [Chris McAloney] >> Okay, so I've been working on level seven for a LONG time now. > > Hmm. I've been staring at that one 18 hours a day since last Friday, > and still don't have the foggiest idea. I've counted boxes, counted > pixels, broken it apart and

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-03 Thread Dan Christensen
Roel Schroeven <[EMAIL PROTECTED]> writes: > Chris McAloney wrote: > >> Hi all, >> >> Okay, so I've been working on level seven for a LONG time now. I've >> decoded the first message to get the hint for the next level. Using the >> same tactics, then I decode the hint as well, but there are non

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-02 Thread Dan Christensen
Dan Christensen <[EMAIL PROTECTED]> writes: > Roel Schroeven <[EMAIL PROTECTED]> writes: > >> There's no level 12 yet though. > > Now there's a 12 and a 13 (at least!). Any hints for level 13? I know how to make a call, but don't know "who

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-02 Thread Dan Christensen
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes: > Dan Christensen wrote: >> Roel Schroeven <[EMAIL PROTECTED]> writes: >> >>> There's no level 12 yet though. >> >> Now there's a 12 and a 13 (at least!). > > Anyone solved 12?

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-01 Thread Dan Christensen
Roel Schroeven <[EMAIL PROTECTED]> writes: > There's no level 12 yet though. Now there's a 12 and a 13 (at least!). Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Veusz 0.5 - a scientific plotting package

2005-04-17 Thread Dan Christensen
Jeremy Sanders <[EMAIL PROTECTED]> writes: > Veusz 0.5 > - > Velvet Ember Under Sky Zenith > - > http://home.gna.org/veusz/ > > Veusz is a scientific plotting package written in Python (currently > 100% Python). It uses PyQt for display and user-interfaces, and

Re: preallocate list

2005-04-13 Thread Dan Christensen
Bill Mill <[EMAIL PROTECTED]> writes: > Bill Mill <[EMAIL PROTECTED]> writes: > >> I would profile your app to see that it's your append which is taking >> ages, but to preallocate a list of strings would look like: >> >> ["This is an average length string" for i in range(approx_length)] I don't

Re: string goes away

2005-03-31 Thread Dan Christensen
"Delaney, Timothy C (Timothy)" <[EMAIL PROTECTED]> writes: > Andreas Beyer wrote: > >> Yeeh, I was expecting something like that. The only reason to use >> map() at all is for improving the performance. >> That is lost when using list comprehensions (as far as I know). So, >> this is *no* option f

Re: ANN: IPython 0.6.5 is out

2004-12-28 Thread Dan Christensen
Fernando Perez <[EMAIL PROTECTED]> writes: > * Added ipython.el to the end-user distribution, for (X)Emacs support, since > now the official python-mode.el from > > http://sourceforge.net/projects/python-mode > > has all the necessary fixes for ipython support (in CVS at this moment). I've never