Re: problem with split

2006-10-06 Thread [EMAIL PROTECTED]
I think I am very close the return line is tripping me up. (this is the first list that I have tried to program in python) return (s.group[1], s.group[2]) Traceback (most recent call last): File "C:\Python24\Lib\site-packages\boa-constructor\test of snake\test_of_csoundroutines_list.py", line

Re: problem with split

2006-10-06 Thread hanumizzle
On 6 Oct 2006 23:09:08 -0700, MonkeeSage <[EMAIL PROTECTED]> wrote: > > > On Oct 6, 11:33 pm, hanumizzle <[EMAIL PROTECTED]> wrote: > > import re > > > > > > > > if line.startswith('instr'): > > p = re.compile(r'(\d+)\s+;(.*)$') > > m = p.search(line) > > > > return (m.group(1), m.group(2)) >

Re: problem with split

2006-10-06 Thread [EMAIL PROTECTED]
I was trying something like this digits = re.compile("\d") if digits in line instr_number = digits.search(line) because it looked realy cool when I saw it in a recent post... and then the same thing for just (';') didn't seem to return anything except one line and some hex that cam

Re: problem with split

2006-10-06 Thread MonkeeSage
On Oct 6, 11:33 pm, hanumizzle <[EMAIL PROTECTED]> wrote: > import re > > > > if line.startswith('instr'): > p = re.compile(r'(\d+)\s+;(.*)$') > m = p.search(line) > > return (m.group(1), m.group(2)) You probably don't want startswith, in case there are initial spaces in the line. Also, sin

Re: Names changed to protect the guilty

2006-10-06 Thread John Machin
Aahz wrote: > In article <[EMAIL PROTECTED]>, > MonkeeSage <[EMAIL PROTECTED]> wrote: > >On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote: > >> > >> The following line of lightly munged code was found in a publicly > >> available Python library... > > > >Yes, this violates the Holy, Inspired, Inf

Notice from auto reply program

2006-10-06 Thread Yoichi Maeda
An e-mail address of Yoichi Maeda has been moved to [EMAIL PROTECTED] Your mail has been forwarded to the new address. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with split

2006-10-06 Thread hanumizzle
On 10/7/06, goyatlah wrote: > Think you need a regex like this: regex = > r"\s*instr\s+([0-9]+)\s*(;.*)?" [0-9] maybe written simply as \d (d for digit) > Then: > import re > test = re.compile(regex) Regexes are usually passed as literals directly to re.compile(). > testing is done as follows:

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread Paddy
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > Ah, wait a moment. One more tweak. Make the body class a psyco class. > > That improves the runtime to 3.02s. Diff appended. > > Nice. Maybe you can do the same trick with: > from psyco.classes import __metaclass__ > > If you want you can

Re: problem with split

2006-10-06 Thread goyatlah
Think you need a regex like this: regex = r"\s*instr\s+([0-9]+)\s*(;.*)?" Then: import re test = re.compile(regex) testing is done as follows: res = test.match(mystring) if res: number = res.group(1) # always a string consisting of decimals comment = res.group(2) # string starting with ;

Re: Can't get around "IndexError: list index out of range"

2006-10-06 Thread MonkeeSage
On Oct 6, 8:23 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > if 2 in [1,2,3]: print "Use the same (in) operator" > elif 'E' in ('E','r','i','k'): print "Works for any sequence" > elif 'o' in 'hello': print "Even strings" This isn't really analogous is it? For "somedict.has_key(k)" or "k in

Re: Python to use a non open source bug tracker?

2006-10-06 Thread [EMAIL PROTECTED]
Jira is a remarkably well done product. We've adopted it internally and use it for project planning (we're doing Agile) as well as defect tracking. The plugin support and user interface just can't be touched by the competition and I've been looking. I'd prefer an open source python based system and

Re: humble coin head or tail game script I wrote

2006-10-06 Thread Camellia
Oh I get it and ashamed, thank you for explaining it to me:) so I sould: ini_guess=random.randrange(2) ... for item in list: if item=='h': ... if item ==t': ... [EMAIL PROTECTED] wrote: > Camellia wrote: > > Well...It' doesn't, have you run it yet? > > Yes it does, and ru

Re: dictionary containing a list

2006-10-06 Thread goyatlah
I think what you mean is that if you change your list, it is changed somewhere in your dicrionary to. Lists are always copied as pointers, except explicitly told other wise. So a = b = [] makes a and be the same list, and a.append(1) makes b -> [1]. So do something like mydict[mykey] = mylist[:] (

Re: problem with split

2006-10-06 Thread hanumizzle
On 6 Oct 2006 21:07:43 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I want comment returned in an array and instr_number returned in an > array. Let me see if I understand what you want: if there is a line that starts with instr (best tested with line.startswith('instr') :)), you want th

Weekly Python Patch/Bug Summary

2006-10-06 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 428 open ( +6) / 3417 closed ( +2) / 3845 total ( +8) Bugs: 939 open ( +6) / 6229 closed (+17) / 7168 total (+23) RFE : 240 open ( +3) / 239 closed ( +0) / 479 total ( +3) New / Reopened Patches __ Speed up

Re: extract certain values from file with re

2006-10-06 Thread hanumizzle
On 6 Oct 2006 13:16:13 -0700, Matteo <[EMAIL PROTECTED]> wrote: > Coming from C++, using exceptions in this way still feels a bit creepy > to me, but I've been assured that this is very pythonic, and I'm slowly > adopting this style in my python code. > > Parsing the line can be easy too: >(um

Re: problem with split

2006-10-06 Thread [EMAIL PROTECTED]
p.s. this is the one I need to finish to release the csoundroutines library www.dexrow.com [EMAIL PROTECTED] wrote: > apologies if I annoy and for spacing (google) > > > > def csdInstrumentList(from_file): > "Returns a list of .csd instruments and any comment lines after the > instrument" >

problem with split

2006-10-06 Thread [EMAIL PROTECTED]
apologies if I annoy and for spacing (google) def csdInstrumentList(from_file): "Returns a list of .csd instruments and any comment lines after the instrument" infile = open(from_file, 'r') temp_number = 0 for line in infile: if 'instr' in line: s = re.split(r

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread James Stroud
James Stroud wrote: > sam wrote: > >> this does what i want, though i don't like the inner while loop having >> to be there [snip] > A little cleaner. Now, lets tighten it up a bit more, and put nested > loops into functions. Im getting rid of keeping track of the running > total, that will clea

Re: Skullsocks to the rescue - was [irrelevant squabble of IL]

2006-10-06 Thread hanumizzle
On 10/6/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Fredrik Lundh schrieb: > > Diez B. Roggisch wrote: > > > >> This is on the same level of interest to the communities of python, > >> ruby & java as the color of my socks this morning - a deep black with > >> cute little skulls imprinted. > >

Re: Recursive descent algorithm able to parse Python?

2006-10-06 Thread hanumizzle
On 10/6/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Lawrence D'Oliveiro schrieb: > > In message <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > > > >> I have to admit that I have difficulties to compare LR(k) to recursive > >> descent, but the fact that the latter contains backtracking makes i

Re: Graph Theory

2006-10-06 Thread boggom
Other than reading the reference on the website https://networkx.lanl.gov/reference/networkx/ you can read the code (eg by browsing the svn by pointing your web browser at https://networkx.lanl.gov/browser/networkx/trunk and then look at networkx -> generators -> random_graphs.py) If you are not

Re: ctypes and setjmp

2006-10-06 Thread Richard Jones
Gabriel Genellina wrote: > At Friday 6/10/2006 16:14, Thomas Heller wrote: >>For ctypes, the only solution I can think of is to invent a new calling >>convention, which will call setjmp() first internally before calling the >>libpng api function... > > May be reasonable - a non-zero in setjmp woul

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread James Stroud
sam wrote: > this does what i want, though i don't like the inner while loop having > to be there > > > def get_pct(): > while True: > pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0], > ['dev', > 0]] > total=0 > for i in range(len(pct_

Re: Names changed to protect the guilty

2006-10-06 Thread Aahz
In article <[EMAIL PROTECTED]>, MonkeeSage <[EMAIL PROTECTED]> wrote: >On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote: >> >> The following line of lightly munged code was found in a publicly >> available Python library... > >Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh), >

Re: [Linux] Detect a key press

2006-10-06 Thread hanumizzle
On 10/6/06, Sergei Organov <[EMAIL PROTECTED]> wrote: > Try > > print "->%s\r" % ch > > or just > > sys.stdout.write(ch) Ah! -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary containing a list

2006-10-06 Thread hanumizzle
On 6 Oct 2006 14:37:59 -0700, Ben <[EMAIL PROTECTED]> wrote: > Is there a way to acheive what I was attempting ? I have done something > almost identical with classes in a list before, and in that case a new > instance was created for each list entry... Not sure what you're trying to pull off, b

Re: dictionary containing a list

2006-10-06 Thread Bryan Olson
Ben wrote: > I have set up a dictionary into whose values I am putting a list. I > loop around and around filling my list each time with new values, then > dumping this list into the dictionary. Or so I thought... > > It would appear that what I am dumping into the dictionary value is > only a poi

Re: Can't get around "IndexError: list index out of range"

2006-10-06 Thread hanumizzle
On 6 Oct 2006 16:57:23 -0700, erikcw <[EMAIL PROTECTED]> wrote: > I ended up using len(sys.argv) > 1 for this particular problem. But I > think slicing is closer to the tool I was looking for. > > I found a.has_key(k) or "k in a" for dictionaries - but haven't found > anything similar for lists.

Re: News on versions modules for Python-2.5?

2006-10-06 Thread MC
Hi again! Thank you, for all answers & contribs. -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread hanumizzle
On 6 Oct 2006 10:57:01 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Again that is not the fault of those that read the documentation. If > this discinction can't be easily made in python 2.X, you can't fault > the reader for coming to a conclusion that seems to follow rather > naturally from ho

Re: Names changed to protect the guilty

2006-10-06 Thread Virgil Dupras
MonkeeSage wrote: > On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote: > > The following line of lightly munged code was found in a publicly > > available Python library... > > Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh), > which was written by the very finger of God when

Re: Names changed to protect the guilty

2006-10-06 Thread MonkeeSage
On Oct 6, 8:34 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > And in the original case, I'd agree that "if X.has_key():" is > quite clear, already yielding a boolian value, and so doesn't > need to be tested for if it's False. But I wouldn't like to test > for an empty list or for None implicitly.

Re: Names changed to protect the guilty

2006-10-06 Thread hanumizzle
On 6 Oct 2006 16:27:51 -0700, Aahz <[EMAIL PROTECTED]> wrote: > The following line of lightly munged code was found in a publicly > available Python library... > > if schema.elements.has_key(key) is False: if not schema.elements.has_key(key): or, actually, if not key in schema.elements: is how

Re: Debugging question: Print out program state (Variables)

2006-10-06 Thread Gabriel Genellina
At Friday 6/10/2006 12:53, Josh Bloom wrote: What I would like to do is write out the state of my script when an error is encountered. I've been looking at the traceback module and think Im on the right track, but I haven't figured out a way to write out all of the programs current variables.

Re: Names changed to protect the guilty

2006-10-06 Thread Gabriel Genellina
At Friday 6/10/2006 22:02, MonkeeSage wrote: > The following line of lightly munged code was found in a publicly > available Python library... Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh), which was written by the very finger of God when the world was still in It's not

Re: Names changed to protect the guilty

2006-10-06 Thread Neil Cerutti
On 2006-10-07, John Machin <[EMAIL PROTECTED]> wrote: > > MonkeeSage wrote: >> On Oct 6, 8:02 pm, "MonkeeSage" <[EMAIL PROTECTED]> wrote: >> > it is clearer to you to make the condition explicit ("blah not False"), >> >> "blah not False" -> "blah is False" > > Whichever way your team wants to inter

Re: Names changed to protect the guilty

2006-10-06 Thread John Machin
MonkeeSage wrote: > On Oct 6, 8:02 pm, "MonkeeSage" <[EMAIL PROTECTED]> wrote: > > it is clearer to you to make the condition explicit ("blah not False"), > > "blah not False" -> "blah is False" Whichever way your team wants to interpret it, d00d. Please consider whether you should be writing "(

Re: Names changed to protect the guilty

2006-10-06 Thread Neil Cerutti
On 2006-10-07, MonkeeSage <[EMAIL PROTECTED]> wrote: > > > On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote: >> The following line of lightly munged code was found in a >> publicly available Python library... > > Yes, this violates the Holy, Inspired, Infallible Style Guide > (pbuh), which was wri

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Steven D'Aprano
On Fri, 06 Oct 2006 12:42:08 +0200, Fredrik Lundh wrote: > Antoon Pardon wrote: > >> IMO this is a very natural thought process for a python programmer. >> So a python programmer seeing the first will tend to expect that >> last call to work. > > on the other hand, if a Python programmer *writes

Re: Can't get around "IndexError: list index out of range"

2006-10-06 Thread Gabriel Genellina
At Friday 6/10/2006 20:57, erikcw wrote: I ended up using len(sys.argv) > 1 for this particular problem. But I think slicing is closer to the tool I was looking for. I found a.has_key(k) or "k in a" for dictionaries - but haven't found anything similar for lists. Does it exist? if 2 in [1,2

Re: Names changed to protect the guilty

2006-10-06 Thread MonkeeSage
On Oct 6, 8:02 pm, "MonkeeSage" <[EMAIL PROTECTED]> wrote: > it is clearer to you to make the condition explicit ("blah not False"), "blah not False" -> "blah is False" -- http://mail.python.org/mailman/listinfo/python-list

Re: Names changed to protect the guilty

2006-10-06 Thread MonkeeSage
On Oct 6, 6:27 pm, [EMAIL PROTECTED] (Aahz) wrote: > The following line of lightly munged code was found in a publicly > available Python library... Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh), which was written by the very finger of God when the world was still in chaot

Re: ctypes and setjmp

2006-10-06 Thread Gabriel Genellina
At Friday 6/10/2006 16:14, Thomas Heller wrote: > Currently ctypes can't play well with any C code that requires use of setjmp > as part of its API. > libpng is one of those libraries. > I didn't know that setjmp/longjmp is actually used by production libraries for error handling. Using setjm

Re: How to execute a python script in .NET application

2006-10-06 Thread hg
Chandra wrote: > Hi, > > Is there a way to execute a python script(file) in ASP.NET application > (programmatically)?? > > Regards, > Chandra > pythondotnet@python.org ? -- http://mail.python.org/mailman/listinfo/python-list

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread sam
this does what i want, though i don't like the inner while loop having to be there def get_pct(): while True: pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0], ['dev', 0]] total=0 for i in range(len(pct_list)):

Re: Can't get around "IndexError: list index out of range"

2006-10-06 Thread erikcw
I ended up using len(sys.argv) > 1 for this particular problem. But I think slicing is closer to the tool I was looking for. I found a.has_key(k) or "k in a" for dictionaries - but haven't found anything similar for lists. Does it exist? I guess my example from php would technically be a dictio

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread sam
you're right, of course. it occurred to me that, even if it were manageable for a few items, it would quickly become absurd as the number of items grew. this: def get_pct(): while True: pct_list=[['cash', 0], ['bond', 0], ['blue', 0], ['tech', 0], ['dev', 0]]

Re: ctypes and setjmp

2006-10-06 Thread Richard Jones
Thomas Heller wrote: > Richard Jones schrieb: >> Currently ctypes can't play well with any C code that requires use of >> setjmp as part of its API. >> >> libpng is one of those libraries. >> >> Can anyone think of a reasonable solution to this? Perhaps ctypes might >> be patched to offer setjmp

Re: dictionary containing a list

2006-10-06 Thread Ben Finney
"Ben" <[EMAIL PROTECTED]> writes: > I have set up a dictionary into whose values I am putting a list. I > loop around and around filling my list each time with new values, > then dumping this list into the dictionary. Or so I thought... Our crystal balls are notoriously unreliable for viewing pro

Re: ctypes, arrays and pointers

2006-10-06 Thread Richard Jones
Thomas Heller wrote: > Richard Jones schrieb: >> row = image_data + width * components * y >> >> but you can't add an int to a c_char_Array_2415600. > > This feature request has now come up the second time, so I guess I will > have to find a solution for it. Someone suggested a byref_at(obj,

Names changed to protect the guilty

2006-10-06 Thread Aahz
The following line of lightly munged code was found in a publicly available Python library... if schema.elements.has_key(key) is False: Sorry, just had to vent. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Ilias Lazaridis
Michael Ströder wrote: > Ilias Lazaridis wrote: > > > > You need just 2 active contributors - and the python community, not > > more > > Hmm, this number does not say much. It really depends on the required > service level and how much time these two people can spend for > maintaining the tracker

How to execute a python script in .NET application

2006-10-06 Thread Chandra
Hi, Is there a way to execute a python script(file) in ASP.NET application (programmatically)?? Regards, Chandra -- http://mail.python.org/mailman/listinfo/python-list

Re: News on versions modules for Python-2.5?

2006-10-06 Thread casevh
> And who can confirm that these modules are independent of Python version? > Gmpy I've compiled gmpy for Python 2.5. It is available at http://home.comcast.net/~casevh/ > (tip: I am on windows, and I don't can/know compile any module) casevh -- http://mail.python.org/mailman/listinfo/pyth

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Paul Boddie
Terry Reedy wrote: > > When SF is down, people sometimes send tracker items to > the pydev list instead, when means someone else (who?) has to put in the > tracker or it gets lost. According to Harald Armin Massa's PostgreSQL talk at EuroPython, the PostgreSQL people manage all their bugs via mail

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread James Stroud
James Stroud wrote: > sam wrote: > >> hi all, >> >> i'm starting to put together a program to simulate the performance of >> an investment portfolio in a monte carlo manner doing x thousand >> iterations and extracting data from the results. >> >> i'm still in the early stages, and am trying to co

Re: dictionary containing a list

2006-10-06 Thread John Machin
Ben wrote: > Hello... > > I have set up a dictionary into whose values I am putting a list. I > loop around and around filling my list each time with new values, then > dumping this list into the dictionary. Or so I thought... > > It would appear that what I am dumping into the dictionary value is

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Terry Reedy
"Giovanni Bajo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > Are bug-tracker configuration issues so critical that having to wait > 48-72hrs > to have them fixed is absolutely unacceptable for Python development? It > looks > like an overexaggeration.

kdb and python

2006-10-06 Thread Doni Ocena
Does anyone know where to find more material on kdb and python integration? I've only found this so far -> http://kx.com/a/k/connect/python/pyk-0.9/ Also, someone once mentioned python tunnelling in kdb but I couldn't find any reading material on it. -Doni -it never ends, ... , + it never ends

dictionary containing a list

2006-10-06 Thread Ben
Hello... I have set up a dictionary into whose values I am putting a list. I loop around and around filling my list each time with new values, then dumping this list into the dictionary. Or so I thought... It would appear that what I am dumping into the dictionary value is only a pointer to the o

Re: error handling in user input: is this natural or just laborious

2006-10-06 Thread James Stroud
sam wrote: > hi all, > > i'm starting to put together a program to simulate the performance of > an investment portfolio in a monte carlo manner doing x thousand > iterations and extracting data from the results. > > i'm still in the early stages, and am trying to code something simple > and inte

Re: Dumping the state of a deadlocked process

2006-10-06 Thread MrJean1
Did you try using the signal module? If not, a basic example is here which may need to be extended. /Jean Brouwers [EMAIL PROTECTED] wrote: > Hi all > > I'm currently having some issues with a process getting deadlocked. The > problem is that the only w

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread Peter Maas
Matteo wrote: > Of course, numpy is not a standard package (though there is a proposal > to add a standard 'array' package to python, based of numpy/numeric), > but if you want to do any numerics with python, you shouldn't be > without it. I know that nbody.py could be speeded up by psyco and nump

Re: humble coin head or tail game script I wrote

2006-10-06 Thread [EMAIL PROTECTED]
Camellia wrote: > Well...It' doesn't, have you run it yet? Yes it does, and running it reflects that behavior. > ini_guess = random.randrange(1) > list_guess = ['t', 'h'] > ini_guess = list_guess[ini_guess] random.randrange(1) will always return 0, so this will always initialize ini_guess to 't'

Re: CGI Tutorial

2006-10-06 Thread Clodoaldo Pinto Neto
[EMAIL PROTECTED] wrote: > Clodoaldo Pinto Neto wrote: > > > print 'The submited name was "' + name + '"' > > Bzzt! Script injection security hole. See cgi.escape and use it (or a > similar function) for *all* text -> HTML output. > > > open('files/' + fileitem.filename, 'w') > > BZZT. filesyst

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread Peter Maas
John J. Lee wrote: > Replacing ** with multiplication in advance() cut it down to 0.78 > times the original running time for me. That brings it along side > PHP, one place below Perl (I didn't bother to upload the edited script). I tried this also but got only 90%. Strange. -- Regards/Gruesse,

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread bearophileHUGS
[EMAIL PROTECTED] wrote: > Ah, wait a moment. One more tweak. Make the body class a psyco class. > That improves the runtime to 3.02s. Diff appended. Nice. Maybe you can do the same trick with: from psyco.classes import __metaclass__ If you want you can try that trick with this version of mine

shortest mean path length

2006-10-06 Thread diffuser78
Is there any function in networkx which can compute the shortest mean path length. (Shortest length between all pairs of the nodes in the graph). Thanks, -- http://mail.python.org/mailman/listinfo/python-list

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: > > try: > > objs.append(marshal.load(fobj)) > > exc

Re: News on versions modules for Python-2.5?

2006-10-06 Thread [EMAIL PROTECTED]
Méta-MCI wrote: > And who can confirm that these modules are independent of Python version? > > ReportLab I can't confirm it's 100% independent, but I have been using reportlab on Windows and Linux with Python 2.5. -- http://mail.python.org/mailman/listinfo/python-list

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread Paul McGuire
"Peter Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have noticed that in the language shootout at shootout.alioth.debian.org > the Python program for the n-body problem is about 50% slower than the > Perl > program. This is an unusual big difference. I tried to make the Py

Re: News on versions modules for Python-2.5?

2006-10-06 Thread John J. Lee
"Méta-MCI" <[EMAIL PROTECTED]> writes: [...] > And who can confirm that these modules are independent of Python version? > > ReportLab [...] Most of the code is pure Python and I don't recall any 2.5-specific bug reports yet. For the (optional) parts that are written in C, there are 2.5 Wind

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread skip
Skip> I took the original version, tweaked it slightly (probably did Skip> about the same things as Python #2, I didn't look). For N == Skip> 200,000 the time went from 21.94s (user+sys) to 17.22s. Using Skip> psyco and binding just the advance function on my improved version

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread Matteo
Peter Maas wrote: > I have noticed that in the language shootout at shootout.alioth.debian.org > the Python program for the n-body problem is about 50% slower than the Perl > program. This is an unusual big difference. I tried to make the Python program > faster but without success. Has anybody an

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread Neil Cerutti
On 2006-10-06, Peter Maas <[EMAIL PROTECTED]> wrote: > I have noticed that in the language shootout at > shootout.alioth.debian.org the Python program for the n-body > problem is about 50% slower than the Perl program. This is an > unusual big difference. I tried to make the Python program > faster

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread skip
Peter> I have noticed that in the language shootout at Peter> shootout.alioth.debian.org the Python program for the n-body Peter> problem is about 50% slower than the Perl program. This is an Peter> unusual big difference. I tried to make the Python program faster Peter> but wi

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread bearophileHUGS
Peter Maas: > I have noticed that in the language shootout at shootout.alioth.debian.org > the Python program for the n-body problem is about 50% slower than the Perl > program. This is an unusual big difference. I tried to make the Python program > faster but without success. Has anybody an explan

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread John J. Lee
Peter Maas <[EMAIL PROTECTED]> writes: > I have noticed that in the language shootout at shootout.alioth.debian.org > the Python program for the n-body problem is about 50% slower than the Perl > program. This is an unusual big difference. I tried to make the Python program > faster but without su

Re: Iterating over marshal

2006-10-06 Thread Fredrik Lundh
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: > try: > objs.append(marshal.load(fobj)) > except EOFError: > break the canonical way to do this is to put the

Re: Graph Theory

2006-10-06 Thread bearophileHUGS
[EMAIL PROTECTED]: > Is there any documentation avaialbe for networkx ? I want to have an > implementation of random graphs including watts and strogatz graph. Try reading the code, often it's simple enough. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: extract certain values from file with re

2006-10-06 Thread Matteo
Fabian Braennstroem wrote: > Hi, > > I would like to remove certain lines from a log files. I had > some sed/awk scripts for this, but now, I want to use python > with its re module for this task. > > Actually, I have two different log files. The first file looks > like: > >... >'some text'

error handling in user input: is this natural or just laborious

2006-10-06 Thread sam
hi all, i'm starting to put together a program to simulate the performance of an investment portfolio in a monte carlo manner doing x thousand iterations and extracting data from the results. i'm still in the early stages, and am trying to code something simple and interactive to get the percenta

Dumping the state of a deadlocked process

2006-10-06 Thread andre . naess
Hi all I'm currently having some issues with a process getting deadlocked. The problem is that the only way I can seem to find information about where it deadlocks is by making a wild guess, insert a pdb.set_trace() before this point, and then step until it locks up, hoping that I've guessed right

Re: extract certain values from file with re

2006-10-06 Thread Paddy
Fabian Braennstroem wrote: > Hi, > > > I actually want to extract the lines with the numbers, write > them to a file and finally use gnuplot for plotting them. A > nicer and more python way would be to extract those numbers, > write them into an array according to their column and plot > t

psycopg: tz import error

2006-10-06 Thread km
Hi all,i have python 2.4.3 and 2.5 versions installed default python interpreter being  2.5have compiled psycopg2 with python2.4.3 setup.py.install , it installs in site-setup of 2.4.3 but when i login as a normal user and get into interctive python prompt of 2.4.3 ,  and " import tz " fails to im

n-body problem at shootout.alioth.debian.org

2006-10-06 Thread Peter Maas
I have noticed that in the language shootout at shootout.alioth.debian.org the Python program for the n-body problem is about 50% slower than the Perl program. This is an unusual big difference. I tried to make the Python program faster but without success. Has anybody an explanation for the differ

Iterating over marshal

2006-10-06 Thread Tim Lesher
I'm using the marshal library to unmarshal a file containing one or more objects. The canonical way seems to be: objs = [] while 1: try: objs.append(marshal.load(fobj)) except EOFError: break Maybe it's just me, but it seems as if this should be iterable. I can get the b

Re: Graph Theory

2006-10-06 Thread diffuser78
Is there any documentation avaialbe for networkx ? I want to have an implementation of random graphs including watts and strogatz graph. [EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > Thanks for your quick reply. Since I have not read the documentation, I > > was wondering if you can gene

Re: help on pickle tool

2006-10-06 Thread Paddy
Paddy wrote: > hanumizzle wrote: > > On 5 Oct 2006 22:25:58 -0700, Paddy <[EMAIL PROTECTED]> wrote: > > > > > You might try picking the data with a different pickle formatter that > > > your Java can use. Maybe an XML pickler > > > (http://www.gnosis.cx/download/Gnosis_Utils.More/Gnosis_Utils-1.2.

Re: switching to numpy and failing, a user story

2006-10-06 Thread Ramon Diaz-Uriarte
On 6 Oct 2006 09:26:23 -0700, Istvan Albert <[EMAIL PROTECTED]> wrote: > sturlamolden wrote: > > > Those involved in the development of NumPy must receive some > > compensation. Financial support to NumPy also ensure that the > > developmentcan continue. I for one does not want to see NumPy as > >

Re: ctypes, arrays and pointers

2006-10-06 Thread Thomas Heller
Richard Jones schrieb: > Does anyone know how to do the equivalent of this using ctypes? > > image_data = malloc(width * height * components); > row_pointers = png_get_rows(png_ptr, info_ptr); > for (y = 0; y < height; y++) > memcpy(&image_data[width * components * y], >

Re: ctypes and setjmp

2006-10-06 Thread Thomas Heller
Richard Jones schrieb: > Currently ctypes can't play well with any C code that requires use of setjmp > as part of its API. > > libpng is one of those libraries. > > Can anyone think of a reasonable solution to this? Perhaps ctypes might be > patched to offer setjmp support in foreign function de

Re: help on pickle tool

2006-10-06 Thread Paddy
hanumizzle wrote: > On 5 Oct 2006 22:25:58 -0700, Paddy <[EMAIL PROTECTED]> wrote: > > > You might try picking the data with a different pickle formatter that > > your Java can use. Maybe an XML pickler > > (http://www.gnosis.cx/download/Gnosis_Utils.More/Gnosis_Utils-1.2.1.ANNOUNCE > > untested b

Re: Need array help

2006-10-06 Thread Larry Bates
Robert Kern wrote: > Larry Bates wrote: > >> If you want to >> do vector math or matrix-type calculations look at the >> array module. > > The array module in the standard library does not provide such > capabilities. If you need them, look at numpy. > > http://numpy.scipy.org > I stand corre

Re: Ctypes and freeing memory

2006-10-06 Thread Thomas Heller
Oliver Andrich schrieb: > On 10/6/06, Thomas Heller <[EMAIL PROTECTED]> wrote: >> Chris Mellon has already pointed out a possible solution, but there is also a >> different way. You could use a subclass of c_char_p as the restype >> attribute: >> >> class String(c_char_p): >> def __del__(self)

Re: News on versions modules for Python-2.5?

2006-10-06 Thread Thomas Heller
Méta-MCI schrieb: > Hi, all! > > > Any news, on release Python-2.5 for many modules/lib? > Some exemples: > > Console (Effbot) > SciPy > Iconvcodec > DirectPython > SendKeys > Dislin > PyGame > Twain > etc. > > > And who can confirm that these modules are in

Re: extract certain values from file with re

2006-10-06 Thread Paul McGuire
"Fabian Braennstroem" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I would like to remove certain lines from a log files. I had > some sed/awk scripts for this, but now, I want to use python > with its re module for this task. > > Actually, I have two different log files.

Re: Need array help

2006-10-06 Thread Paul McGuire
"Marion Long Jr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am switching from microsoft visual basic programming to python >programming. Also, in anticipation of one of the most FA'ed Q's among VB->Python migrators, you must always include the parens after a function name to

Re: How can I correct an error in an old post?

2006-10-06 Thread Paul Boddie
Tim Roberts wrote: > > Although it might be mirrored on a web site somewhere, this is a Usenet > newsgroup. It is impossible to "close" a thread. The concept simply does > not exist. Apparently, the fashionable approach to "closing a thread" is to post a critique of thread contributors to one's

  1   2   3   >