Re: Python Standardization: Wikipedia entry

2008-02-01 Thread Daniel Fetchinson
> Depends entirely on the operative meaning of standardized. Formal > standards body? Obviously no. > > Specified in a standard-setting document? Yes. In fact, in someways, > Python is better standardized that C, for instance, in that the Python > standard usefully standardizes some things that t

giving imp.load_module not a real file, HOW?

2008-02-01 Thread Paul Sijben
I am running into a problem with the python interpreter's internals. For some reason imp.load_module insists on getting a real open file as the second parameter. I have not able to fool it with stringIO or overloaded file objects. So now I have two questions: 1) why does load_module insist on a r

Re: dict comprehension

2008-02-01 Thread Paul McGuire
On Feb 1, 12:13 am, Paddy <[EMAIL PROTECTED]> wrote: > On Feb 1, 6:06 am, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: > > > > On Behalf Of Daniel Fetchinson > > > What does the author mean here? What's the Preferably One Way > > > (TM) to do something analogous to a dict comprehension? > > > I imagi

Re: psycopg2

2008-02-01 Thread Andre' John
Thanks very much, this was indeed the problem. That column was an array. I created it via GUI and was wondering why it did append a '[]' to the variable type, but didn't bother, because there was no other varchar available. Cheers Andre PS: Weird though how few results turn up when running th

Re: dict comprehension

2008-02-01 Thread bearophileHUGS
Paul McGuire: > Why not just > D = dict(zip(keys,values)) > ?? Because this may require less memory: from itertools import izip D = dict(izip(keys, values)) :-) Bear hugs, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Matthew_WARREN
Usually. I this case though, I really wasnt planning ahead too much as I wrote it and thats the way it happened... not the best of excuses I know. I've been thinking about the consequences though, and I'd have to run it to see really, but I'm thinking looking for average population fitness should

Re: regular expression negate a word (not character)

2008-02-01 Thread Dr.Ruud
Greg Bacon schreef: > Dr.Ruud: >> I negated the test, to make the regex simpler: [...] > > Yes, your approach is simpler. I assumed from the "need it all > in one pattern" constraint that the OP is feeding the regular > expression to some other program that is looking for matches. Yes, I assumed

Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-02-01 Thread Steve Holden
Eduardo O. Padoan wrote: > On Feb 1, 2008 5:19 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> On Feb 1, 5:08 am, Paddy <[EMAIL PROTECTED]> wrote: >>> On Feb 1, 1:26 am, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: >>> >>> >>> To Everyone on the planet Earth, Please accept my apolog

Re: psycopg2

2008-02-01 Thread Steve Holden
Andre' John wrote: > Thanks very much, this was indeed the problem. That column was an array. > I created it via GUI and was wondering why it did append a '[]' to the > variable type, but didn't bother, because there was no other varchar > available. > If you're using pgAdmin then try "characte

Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-02-01 Thread Eduardo O. Padoan
On Feb 1, 2008 5:19 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > On Feb 1, 5:08 am, Paddy <[EMAIL PROTECTED]> wrote: > > On Feb 1, 1:26 am, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > > > > > > > > > To Everyone on the planet Earth, > > > > > Please accept my apologies for > > > > > Wh

Need Smart Phone with new features? please click here

2008-02-01 Thread Farooq
www.enmac.com.hk GSM Mobile Phones, Digital iPods, Digital Clocks, Digital Pens, Digital Quran. Enjoy these products with Islamic Features (Complete Holy Quran with Text and Audio, Tafaseer books, Ahadees Books, Daily Supplications, Universal Qibla Direction, Prayer Timing and much more) visit our

Re: piping into a python script

2008-02-01 Thread anonymous
I'm not sure I understane the question but my contribution is : import sys names = sys.argv[1:] line = 'x' while line: line = sys.stdin.readline().strip() if line: names.append (line) print "names=", names Called using: ls | stdtest.py arg1 arg2 arg3 Does this help? Andy -- http

Re: Python Standardization: Wikipedia entry

2008-02-01 Thread Bruno Desthuilliers
John Nagle a écrit : (snip) > Python is not standardized by any standards body. > And no > two implementations are even close to compiling the same language. > > A consequence of the lack of standardization is that it discourages > implementations. There are about four implementations of som

MyHDL (was Re: Will Python on day replace MATLAB...)

2008-02-01 Thread Neal Becker
I was not aware of MyHDL, sounds interesting. But, last release was May 2006. I wonder if it still active? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Thomas Pani
Arnaud Delobelle wrote: > > This is definitely the best way: > > from itertools import chain > > def overlaps(lst): > bounds = chain(*(((x[1],i), (x[2], i)) for i,x in enumerate(lst))) > inside = {} > for x, i in sorted(bounds): > if inside.pop(i, None) is None: >

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Matthew_WARREN
looking into speeding up the GA code I posted, I ran it with cProfile. Fri Feb 01 11:05:57 2008evprof 30100116 function calls in 93.614 CPU seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 7160929 34.5420.000 37

IoC and MVC Frameworks

2008-02-01 Thread Robert Rawlins - Think Blue
Hello Guys, I've been working on a little pet project for a while now, using it as a learning exercise for Python and its starting to grow nicely, I'm now looking into refactoring it a little in a more OO fashion and I've always been a real fan of design patterns and all those fun kind of thing

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Matthew_WARREN
Internet

Re: Naive idiom questions

2008-02-01 Thread Wildemar Wildenburger
Carl Banks wrote: > Not a big expert on docstrings (they seem so superfluous...) > Say wht?! /W -- http://mail.python.org/mailman/listinfo/python-list

SimpleXMLRPCServer to fastcgi via WSGI?

2008-02-01 Thread Ivan Voras
Hi, Is there a straightforward way to convert an XML-RPC server application (written for SimpleXMLRPCServer) to use WSGI so that it can be used as s fastcgi server? By "straightforward" I mean something simple, without using some external framework. Alternatively, I don't really care about WSGI,

Re: Python Standardization: Wikipedia entry

2008-02-01 Thread Pete Forman
Paul Boddie <[EMAIL PROTECTED]> writes: > Yes, you don't really want standardisation ANSI/ISO-style as the > standards themselves are not freely distributable Some ISO standards have been made available for free. Copyright terms apply. Over 300 are listed here: http://standards.iso.org/itt

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-02-01 Thread Pete Forman
Jaap Spies <[EMAIL PROTECTED]> writes: > Have a look at Sage: http://www.sagemath.org/ Of relevance to SciPy is the following http://wiki.sagemath.org/days8 | The Sage_ and Scipy_ teams and `Enthought Inc.`_ are pleased to | announce the first collaborative meeting for Sage/Scipy joint | de

Re: how to include text data in source code?

2008-02-01 Thread Matimus
On Feb 1, 9:28 am, "Sun" <[EMAIL PROTECTED]> wrote: > as the subject, I 'd like to know how to include a piece of text as input in > the source code so that I do not need to read in data from files. I remember > there is some thing like this in Perl, have no idea if python has the same > thing? > >

Re: Python Standardization: Wikipedia entry

2008-02-01 Thread Paddy
On Feb 1, 12:13 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > Ultimately, this leaves the W3C as the only genuinely open formal > standards body that I can think of immediately, but I think Python is > somewhat peripheral for them, despite extensive usage of Python by > various W3C people. > > Paul

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Matthew_WARREN
On Jan 31, 10:43 am, [EMAIL PROTECTED] wrote: > > Hi, > > > > I got some help with this from here, and there's been a little bit of > > discussion around GA's recently, so thought I'd post up my likey slow and > > clunky version of a GA that in essence just 'evolves' a solution to 'make a > > S

Re: char string 2 hex string

2008-02-01 Thread Antonio Chay
On Jan 31, 7:09 pm, Paul Rubin wrote: > Antonio Chay <[EMAIL PROTECTED]> writes: > > "AAA" should be "414141" > > 'AAA'.encode('hex') 8-O Cool stuff! Thanks! -- http://mail.python.org/mailman/listinfo/python-list

issues with searching through dictionaries for certain values

2008-02-01 Thread Connolly
Hey, Right basically I've got to the end of my main section of my program an I've got it comparing the same dictionary to ensure that the values are the same (sounds stupid I know), yet what my line of code I am using to do this is failing to do is to check every single value. It is only checki

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Paul McGuire
On Jan 31, 10:43 am, [EMAIL PROTECTED] wrote: > Hi, > > I got some help with this from here, and there's been a little bit of > discussion around GA's recently, so thought I'd post up my likey slow and > clunky version of a GA that in essence just 'evolves' a solution to 'make a > sum that evaluate

Re: MyHDL (was Re: Will Python on day replace MATLAB...)

2008-02-01 Thread Jan Decaluwe
Neal Becker wrote: > I was not aware of MyHDL, sounds interesting. > > But, last release was May 2006. I wonder if it still active? Certainly, but I'm so busy doing designs with it that there 's no time for new releases :-) Seriously, I'm working hard on conversion to VHDL which is a major new

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Matthew_WARREN
>> What is the best way to in python to identify the list items that >> overlap and the items that don't overlap with any other. >> >Is this usable? >Assuming you transform your 3 tuples into a list of start-end 2 tuples and sort them for lowest to highest, then >lst=[(55,58,52),(20,22,18

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread Tim Chase
> I actually expect hell to have the largest computing powers in > the universe. What do you think how many IBM, Solaris, > don't-ask-me-what machines admins have already sent down > there? Seems like they'd have trouble with cooling problems... (okay, I was just told yesterday that "hell is hot"

Re: Python Standardization: Wikipedia entry

2008-02-01 Thread Paul Boddie
On 1 Feb, 01:18, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > ANSI standards are owned by ANSI or perhaps the accrediting body. In any > case, electronic copies sell for $30. They cannot legally be accessed free > as for the docs at python.org. Yes, you don't really want standardisation ANSI/ISO

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 11:23 am, Thomas Pani <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle wrote: > > > This is definitely the best way: > > > from itertools import chain > > > def overlaps(lst): > >     bounds = chain(*(((x[1],i), (x[2], i)) for i,x in enumerate(lst))) > >     inside = {} > >     for x, i in s

Pyrex bitten by the exception bug

2008-02-01 Thread Paul Sijben
I am running into the (apparently) well-known issue with pyrex that trying to raise an exception using python2.5 and pyrex will lead to a TypeError, as "TypeError: exceptions must be strings, classes, or instances, not exceptions.ImportError" Is there a fixc for this issue? best regards, Paul Si

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread Tim Golden
Bjoern Schliessmann wrote: > Stefan Behnel wrote: > >> How do you know people in hell aren't doing any programming in >> Python? > > Common sense. In hell, everything is hacked together using Perl. Although see: http://xkcd.com/224/ TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-02-01 Thread Stef Mientki
Blubaugh, David A. wrote: > To All, > > > I have been evaluating the python environment ever more closer. I > believe I can interface python with a development environment known as > the ImpulseC environment. The ImpulseC environment develops C to VHDL > for FPGA development. I would especial

how to include text data in source code?

2008-02-01 Thread Sun
as the subject, I 'd like to know how to include a piece of text as input in the source code so that I do not need to read in data from files. I remember there is some thing like this in Perl, have no idea if python has the same thing? Thanks. -- http://mail.python.org/mailman/listinfo/pyth

Re: issues with searching through dictionaries for certain values

2008-02-01 Thread Steve Holden
Connolly wrote: > Hey, > > Right basically I've got to the end of my main section of my program an I've > got it comparing the same dictionary to ensure that the values are the same > (sounds stupid I know), yet what my line of code I am using to do this is > failing to do is to check every sin

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-02-01 Thread Jaap Spies
Stef Mientki wrote: > Blubaugh, David A. wrote: >> To All, >> >> >> I have been evaluating the python environment ever more closer. I >> believe I can interface python with a development environment known as >> the ImpulseC environment. The ImpulseC environment develops C to VHDL >> for FPGA deve

Re: dict comprehension

2008-02-01 Thread Wildemar Wildenburger
Arnaud Delobelle wrote: >> I believe both set and dict comprehensions will be in 3.0. > > Python 3.0a1+ (py3k:59330, Dec 4 2007, 18:44:39) > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin > Type "help", "copyright", "credits" or "license" for more information. {x*x for x in range(10)} > {0, 1

Re: issues with searching through dictionaries for certain values

2008-02-01 Thread Sion Arrowsmith
Connolly <[EMAIL PROTECTED]> wrote: >Right basically I've got to the end of my main section of my program an I've >got it comparing the same dictionary to ensure that the values are the same >(sounds stupid I know), yet what my line of code I am using to do this is >failing to do is to check eve

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread Bjoern Schliessmann
Stefan Behnel wrote: > How do you know people in hell aren't doing any programming in > Python? Common sense. In hell, everything is hacked together using Perl. Regards, Björn (running for cover :) ) -- BOFH excuse #324: Your packets were eaten by the terminator -- http://mail.python.org

Re: how to include text data in source code?

2008-02-01 Thread Paddy
On Feb 1, 2:28 pm, "Sun" <[EMAIL PROTECTED]> wrote: > as the subject, I 'd like to know how to include a piece of text as input in > the source code so that I do not need to read in data from files. I remember > there is some thing like this in Perl, have no idea if python has the same > thing? > >

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Neil Cerutti
On Feb 1, 2008 8:28 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Yours is O(n^2) and \Omega(n^2). I think mine is O(max(c, nlogn)) > (assuming constant time access for dictionaries, but 'inside' could be > replaced with a list) where c is the number of overlaps. I'll try to > post a proof l

MyHDL project !!!!!

2008-02-01 Thread Blubaugh, David A.
Dan, I would be honored to start a project such as that in mind. How do we begin ?? David Blubaugh -Original Message- From: chewie54 [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 9:34 PM To: python-list@python.org Subject: Re: Will Python on day replaceMATLAB

Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-02-01 Thread Robert Dailey
> > And for top-posting :) That's a matter of opinion ;) -- http://mail.python.org/mailman/listinfo/python-list

How to convert markup text to plain text in python?

2008-02-01 Thread geoffbache
I have some marked up text and would like to convert it to plain text, by simply removing all the tags. Of course I can do it from first principles but I felt that among all Python's markup tools there must be something that would do this simply, without having to create an XML parser etc. I've lo

Re: giving imp.load_module not a real file, HOW?

2008-02-01 Thread Christian Heimes
Paul Sijben wrote: > For some reason imp.load_module insists on getting a real open file as > the second parameter. I have not able to fool it with stringIO or > overloaded file objects. > > So now I have two questions: > 1) why does load_module insist on a real file > 2) is there a way around it

Re: How to convert markup text to plain text in python?

2008-02-01 Thread ph
On 01-Feb-2008, geoffbache wrote: > I have some marked up text and would like to convert it to plain text, > by simply removing all the tags. Of course I can do it from first > principles but I felt that among all Python's markup tools there must > be something that would do this simply, without ha

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-02-01 Thread Robert Dailey
> > This is not part of his Masters... :-) Lmfao -- http://mail.python.org/mailman/listinfo/python-list

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Paul McGuire
On Feb 1, 9:11 am, [EMAIL PROTECTED] wrote: > > > 0. Tack this bit onto the end of quickga.py, and you wont have to > > write a separate routine to import quickga and invoke evolve(): > > >     if __name__ == "__main__": > >         evolve() > > I hear you, but something I dont tend to do as I use

Re: MyHDL project !!!!!

2008-02-01 Thread chewie54
> Dan, > > I would be honored to start a project such as that in mind. How do we > begin ?? > > David Blubaugh > > > Why not use MyHDL which is written in Python and translates to Verilog. > I assume ImpulseC is a commercial product and costs a log. MyHDL is > free. > If you have any interest

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Matthew_WARREN
On Feb 1, 9:11 am, [EMAIL PROTECTED] wrote: > > > 0. Tack this bit onto the end of quickga.py, and you wont have to > > write a separate routine to import quickga and invoke evolve(): > > > > >     if __name__ == "__main__": > > >         evolve() > > > > I hear you, but something I dont ten

Re: CDA conversion

2008-02-01 Thread Dan Upton
On Jan 31, 2008 9:00 PM, Sick Monkey <[EMAIL PROTECTED]> wrote: > Good evening. I am trying to write an application in Python that will allow > a person to insert a CD into their computer and this python script will > convert the music to mp3. > > NOTE: I have already google'd this, and nothing r

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Paul McGuire
On Jan 31, 10:43 am, [EMAIL PROTECTED] wrote: > Hi, > > I got some help with this from here, and there's been a little bit of > discussion around GA's recently, so thought I'd post up my likey slow and > clunky version of a GA that in essence just 'evolves' a solution to 'make a > sum that evaluate

Re: issues with searching through dictionaries for certain values

2008-02-01 Thread Zentrader
On Feb 1, 6:27 am, "Connolly" <[EMAIL PROTECTED]> wrote: > Hey, > > Right basically I've got to the end of my main section of my program an I've > got it comparing the same dictionary to ensure that the values are the same > (sounds stupid I know), yet what my line of code I am using to do this is

Re: How to convert markup text to plain text in python?

2008-02-01 Thread Tim Chase
> I have some marked up text and would like to convert it to plain text, > by simply removing all the tags. Of course I can do it from first > principles but I felt that among all Python's markup tools there must > be something that would do this simply, without having to create an > XML parser etc

Re: Will Python on day replace MATLAB?

2008-02-01 Thread Steve Holden
Pete Forman wrote: > Jaap Spies <[EMAIL PROTECTED]> writes: > > > Have a look at Sage: http://www.sagemath.org/ > > Of relevance to SciPy is the following > > http://wiki.sagemath.org/days8 > > | The Sage_ and Scipy_ teams and `Enthought Inc.`_ are pleased to > | announce the first collabora

checkpoint/restart python processes

2008-02-01 Thread Neal Becker
Hi numeric processing fans. I'm pleased to report that you can now have convenient checkpoint/restart, at least if you are running fedora linux. Example: python -i blcr_mod.py <<< this will start python, then checkpoint it c_int(2) (ignore this debug) >>> [quit] cr_restart checkpoint.nbecker1.2

Re: PyWeek 6 is coming!

2008-02-01 Thread rockingred
On Jan 31, 4:11 pm, [EMAIL PROTECTED] wrote: > PyWeek 6 will run from 00:00 UTC on March 30th through to 00:00 UTC on April > 6th. > > Registration is NOT OPEN YET. It will open on Friday 2008/02/29. > > If you're new (or even coming back again) please have a look at the rules and > help pages atht

Re: How to convert markup text to plain text in python?

2008-02-01 Thread Steve Holden
Tim Chase wrote: >> I have some marked up text and would like to convert it to plain text, >> by simply removing all the tags. Of course I can do it from first >> principles but I felt that among all Python's markup tools there must >> be something that would do this simply, without having to creat

Re: How to convert markup text to plain text in python?

2008-02-01 Thread Tim Chase
>> Well, if all you want to do is remove everything from a "<" to a >> ">", you can use >> >> >>> s = "Today is Friday" >> >>> import re >> >>> r = re.compile('<[^>]*>') >> >>> print r.sub('', s) >> Today is Friday >> [Tim's ramblings about pathological cases snipped] > > The real answer

Re: How to convert markup text to plain text in python?

2008-02-01 Thread Paul McGuire
On Feb 1, 10:54 am, Tim Chase <[EMAIL PROTECTED]> wrote: > >> Well, if all you want to do is remove everything from a "<" to a > >> ">", you can use > > >>   >>> s = "Today is Friday" > >>   >>> import re > >>   >>> r = re.compile('<[^>]*>') > >>   >>> print r.sub('', s) > >>   Today is Friday > >

Re: Removal of element from list while traversing causes the next element to be skipped

2008-02-01 Thread William McBrine
On Wed, 30 Jan 2008 06:07:45 -0800, cokofreedom wrote: > Anyone else noticed that the OP has not actually replied to any of the > suggestions... Sorry. I was just fascinated at the turns it was taking. But the first answer was fine for me: for name in apps[:]: etc. Thanks all. -- 09 F9 11

Re: how to include text data in source code?

2008-02-01 Thread Sun
"Matimus" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Feb 1, 9:28 am, "Sun" <[EMAIL PROTECTED]> wrote: >> as the subject, I 'd like to know how to include a piece of text as input >> in >> the source code so that I do not need to read in data from files. I >> remember >> th

Re: Pyrex bitten by the exception bug

2008-02-01 Thread bearophileHUGS
Paul Sijben: > Is there a fixc for this issue? At the moment I think it's better to drop Pyrex and to use Cython. Maybe you can try that, or ask to their developers. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Matthew_WARREN
> Another interesting technique, similar to GA, is SA or Simulated > Annealing. You should be able to adapt your quickga.py program to an > SA approach without too much trouble, and comparing the two should > tickle your academic bemusement. I shall take a look. This message and any at

Re: MyHDL project

2008-02-01 Thread Steve Holden
chewie54 wrote: >> Dan, >> >> I would be honored to start a project such as that in mind. How do we >> begin ?? >> >> David Blubaugh >> >> >> Why not use MyHDL which is written in Python and translates to Verilog. >> I assume ImpulseC is a commercial product and costs a log. MyHDL is >> free.

Half-Broken filetype association in XP

2008-02-01 Thread Gerry
Under XP, until yesterday, I typed a.py in a dos box and a.py ran fine; typed a.xls and opened an excel window; typed a.doc and opened a word Document. Type, all of those fail - if typed in a DOS window. They all work -- if clicked in an explorer window. The registry looks fine (to me, fwtw):

Meta Class

2008-02-01 Thread Trevor Johnson
Hi; I think I have a good candidate for a meta class here. Never done this before and would like someone to help. In the code that follows, there is one variable that needs to be changed: the letter 'a' as inserted in construction of the variable 'word'. In other applications, I will need to change

Re: Pyrex bitten by the exception bug

2008-02-01 Thread Stefan Behnel
Paul Sijben wrote: > I am running into the (apparently) well-known issue with pyrex that > trying to raise an exception using python2.5 and pyrex will lead to a > TypeError, as "TypeError: exceptions must be strings, classes, or > instances, not exceptions.ImportError" You should use a recent Pyre

Re: dict comprehension

2008-02-01 Thread Stefan Behnel
Wildemar Wildenburger wrote: > Arnaud Delobelle wrote: >>> I believe both set and dict comprehensions will be in 3.0. >> >> Python 3.0a1+ (py3k:59330, Dec 4 2007, 18:44:39) >> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >>

Re: MyHDL project !!!!!

2008-02-01 Thread Grant Edwards
On 2008-02-01, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > I would be honored to start a project such as that in mind. > How do we begin ?? You need to get the punctuation keys on your keyboard fixed. They're sticking, and it's making your posts look like they come from a hyperactive 4th

MyHDL project for FPGA development!

2008-02-01 Thread Blubaugh, David A.
Dan, Thank you very much for your reply. My Master's thesis is for Wright State University and is of the following nature: I am currently engaged with a Masters project, that utilizes a linear array of isotropic sensors, or in my case electromagnetic antennas. I am trying to develop a special

Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
I have a module that uses xml.sax and feeds it a string of xml as in xml.sax.parseString(dictfile,handler) The xml is always encoded in utf-16, and the XML string always starts with This almost always works fine, but two users of this module get an exception whatever input they use it on. (The

Re: SimpleXMLRPCServer to fastcgi via WSGI?

2008-02-01 Thread Joshua Kugler
Ivan Voras wrote: > Is there a straightforward way to convert an XML-RPC server application > (written for SimpleXMLRPCServer) to use WSGI so that it can be used as s > fastcgi server? By "straightforward" I mean something simple, without > using some external framework. > > Alternatively, I don't

lxml 2.0 released

2008-02-01 Thread Stefan Behnel
Hi everyone, I'm very happy to announce the official release of lxml 2.0! http://codespeak.net/lxml/ http://pypi.python.org/pypi/lxml/2.0 ** What is lxml? """ In short: lxml is the most feature-rich and easy-to-use library for working with XML and HTML in the Python language. lxml is a Pythoni

Re: read_nonblocking error in pxssh

2008-02-01 Thread kayvansylvan
On Jan 16, 9:24 am, jrpfinch <[EMAIL PROTECTED]> wrote: > I'm attempting to use thepxsshto execute commands on a remote > machine and do stuff with the output. Both machines are running SSH > Version Sun_SSH_1.0, protocol versions 1.5/2.0 and Intel Solaris 9. > > I am hitting a problem with read_n

Nested compound statements.

2008-02-01 Thread Neil Cerutti
The docs say: A suite can be one or more semicolon-separated simple statements on the same line as the header, following the header's colon, or it can be one or more indented statements on subsequent lines. Only the latter form of suite can contain nested compound statements; the following is il

Re: Pyrex bitten by the exception bug

2008-02-01 Thread Paul Sijben
Stefan Behnel wrote: > Paul Sijben wrote: >> I am running into the (apparently) well-known issue with pyrex that >> trying to raise an exception using python2.5 and pyrex will lead to a >> TypeError, as "TypeError: exceptions must be strings, classes, or >> instances, not exceptions.ImportError" >

proxy testing code with multi-thread

2008-02-01 Thread [EMAIL PROTECTED]
hi all I'm now meeting some problem when using threading to test whether or not a proxy is good or not and the total number of proxies is just 60 but each time my programme stopped just at approaching the end, say, for each proxy I made a proxy but it just stopped working at maybe 58 or 59 or some

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 1:28 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Yours  is O(n^2) and \Omega(n^2).  I think mine is O(max(c, nlogn)) > (assuming constant time access for dictionaries, but 'inside' could be > replaced with a list) where c is the number of overlaps.  I'll try to > post a proof later

Re: very simple Genetic Algorithm completed

2008-02-01 Thread Carl Banks
On Feb 1, 9:09 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > 2. Bugfix: In 2 places, change: > newgene=genes[randint(0,14)-1] > to > newgene=genes[randint(0,14-1)] > > randint(a,b) returns values from a to b inclusive, and genes is a list > containing 14 elements (so you want subsc

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread Martin v. Löwis
> Seems like they'd have trouble with cooling problems... > (okay, I was just told yesterday that "hell is hot" is a > culturally relative thing, and that the Nordic version of hell > involves extreme cold. ymmv) That depends on the rate at which hell is expanding. If it is expanding at a slower

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 2:44 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > On Feb 1, 2008 8:28 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > > Yours  is O(n^2) and \Omega(n^2).  I think mine is O(max(c, nlogn)) > > (assuming constant time access for dictionaries, but 'inside' could be > > replaced with a

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Karthik Gurusamy
On Jan 31, 8:12 am, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list of numbers each with a +/- margin of error. I need to > identify which ones overlab each other. > > For example: > 55 +/- 3 > 20 +/- 2 > 17 +/- 4 > 60 +/- 3 > > #base, max, min > list = [ > (55, 58, 52), > (20, 22, 18),

Re: subprocess and & (ampersand)

2008-02-01 Thread Albert van der Horst
In article <[EMAIL PROTECTED]>, Tim Golden <[EMAIL PROTECTED]> wrote: > >So, even assuming we're looking at the same situation, >I suppose one solution for you is to break out the >.bat file. But that may not be a possibility. Unless you need compatibility with Windows 3.1., I suggest you stay a

build tool opinions

2008-02-01 Thread Tim Arnold
Hi, I'm going through the various build tools (i.e., make-like) available and could use some advice. My documentation-build system is written in python and uses the pdflatex and plasTeX engines to create pdfs, html, and docbook XML from latex source files. All that is ok, but I can clean up a l

Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Giampaolo Rodola'
Hi, I'm trying to solve a jython-related issue and I discovered a different behavior affecting os.path.isabs between CPython and Jython. C:\Python23>python.exe Python 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Steve Holden
Giampaolo Rodola' wrote: > Hi, > I'm trying to solve a jython-related issue and I discovered a > different behavior affecting os.path.isabs between CPython and Jython. > > > C:\Python23>python.exe > Python 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] > on win32 > Type "help", "c

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
On Feb 1, 1:22 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > In both of these cases, there are only plain, 7-bit ascii characters > > in the xml, and it really is valid utf-16 as far as I can tell. > > What do you mean by "7-bit ascii characters"? If it means what I think > it means (namely,

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 8:17 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: [...] > def strip_sort (a, b): >     if a[0] < b[0]: >         return -1 >     if a[0] > b[0]: >         return 1 >     if a[0] == 'L': return -1 >     return 0 > > def overlaps (strips_given): >     s2 = [((s[0], 'L', i) , (s[1], 'R',

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Martin v. Löwis
> In both of these cases, there are only plain, 7-bit ascii characters > in the xml, and it really is valid utf-16 as far as I can tell. What do you mean by "7-bit ascii characters"? If it means what I think it means (namely, a sequence of bytes whose values are between 1 and 127), then it is *no

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Neil Cerutti
On Feb 1, 2008 3:16 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Feb 1, 2:44 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > > Here's another contender, basically the same as yours, but spelled > > without iterators. > > > > def overlaps(eranges): > > """Determine, from a list of number

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread Martin v. Löwis
> They sent me the actual file, which was created on Windows, as an > email attachment. They had also sent the actual dataset from which > the XML was generated so that I could generate it myself using the > same version of our app as the user has. I did that but did not get > an exception. So

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Arnaud Delobelle
On Feb 1, 8:34 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > On Feb 1, 2008 3:16 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > The total number of iterations is 1+2+...+n = n(n+1)/2 (when n is the > > number of intervals) so this has quadratic behaviour regardless of > > input.[...] > But

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Giampaolo Rodola'
On Feb 1, 9:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > > I'm trying to solve a jython-related issue and I discovered a > > different behavior affecting os.path.isabs between CPython and > > Jython. > > [...] > > > Is there a rea

Re: Mysterious xml.sax Encoding Exception

2008-02-01 Thread JKPeck
On Feb 1, 1:51 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > They sent me the actual file, which was created on Windows, as an > > email attachment. They had also sent the actual dataset from which > > the XML was generated so that I could generate it myself using the > > same version of o

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Grant Edwards
On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > I'm trying to solve a jython-related issue and I discovered a > different behavior affecting os.path.isabs between CPython and > Jython. [...] > Is there a reason why "/" is considered an absolute pathname > by CPython? Sure seems li

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Grant Edwards
On 2008-02-01, Steve Holden <[EMAIL PROTECTED]> wrote: > Personally I'd say it was Jython that was wrong. Anything > beginning with a slash has to be absolute - "/" and "\" are > treated as equivalent in most parts of the Windows > environment. I guess it depends on your definition of "absolute".

  1   2   >