Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Heiko Wundram
Am Mittwoch, 30. Juli 2008 08:30:48 schrieb Russ P.: > On Jul 29, 11:09 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > I'm getting this sneaking suspicion that you guys are all putting us on. > > As I said in an earlier post, I realize that this would only work if > there were only one copy of

Re: I CAN connect socket to any localhost port but I shouldn't be able to

2008-07-30 Thread qvx
On Jul 30, 4:48 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 29 Jul 2008 14:56:08 -0300, qvx <[EMAIL PROTECTED]> escribi : > > > I don't have server listening on port 8084 but I can open socket to it > > (and to many other ports, tested for all<8000) > > Your example fails -as expec

Re: Python embedding question (2).

2008-07-30 Thread Pierre-Alain Dorange
Thomas Troeger <[EMAIL PROTECTED]> wrote: > I've managed to put together a small pyGame program, it runs smoothly > and seems to be exactly what I wanted. It's fast! Even with 100 moving > objects it still runs so fast that I can consider using Python/pyGame > for the whole project. > > There are

Re: Native Code vs. Python code for modules

2008-07-30 Thread Paddy
On Jul 30, 4:56 am, koblas <[EMAIL PROTECTED]> wrote: > Ruby has been getting pummeled for the last year or more on the > performance subject.  They've been working hard at improving it.  From > my arm chair perspective Python is sitting on it's laurels and not > taking this as seriously as it prob

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 12:03 am, Heiko Wundram <[EMAIL PROTECTED]> wrote: > Am Mittwoch, 30. Juli 2008 08:30:48 schrieb Russ P.: > > > On Jul 29, 11:09 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > > I'm getting this sneaking suspicion that you guys are all putting us on. > > > As I said in an earlier po

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Heiko Wundram
Am Mittwoch, 30. Juli 2008 09:18:48 schrieb Russ P.: > Oh, Lordy. I understand perfectly well how boolean tests, __len__, and > __nonzero__ work in Python. It's very basic stuff. You can quit > patronizing me (and Carl too, I'm sure). I'll stop repeating what the current state is (which might soun

Re: Using McMillan Installer, PyInstall or py2exe cross-platform?

2008-07-30 Thread Hartmut Goebel
Paul Boddie schrieb: On 15 Jul, 23:00, Hartmut Goebel <[EMAIL PROTECTED]> wrote: I started working on cross-pyinstall today. Let us know how you get on! In theory, one should be able to build Python (and derived works) using the mingw32 libraries and a suitable cross-compiler on platforms othe

Re: Questions about asyncore

2008-07-30 Thread Frank Millman
On Jul 29, 3:40 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > On 29 Lug, 13:09, Frank Millman <[EMAIL PROTECTED]> wrote: Thanks for the reply, Giampaolo. > > The benefit of asynchat is that it automatically handles the buffering > of both input and output. > Aside from set/found_terminator

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 12:49 am, Heiko Wundram <[EMAIL PROTECTED]> wrote: > Am Mittwoch, 30. Juli 2008 09:18:48 schrieb Russ P.: > > > Oh, Lordy. I understand perfectly well how boolean tests, __len__, and > > __nonzero__ work in Python. It's very basic stuff. You can quit > > patronizing me (and Carl too, I'm

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
Russ P. wrote: On Jul 29, 11:36 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: Russ P. wrote: Come to think of it, shouldn't the list type have an "isempty" method? Or does it? Yes. It's written: if not aList: ... As you know, that is not quite exactly the same thing.

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
Carl Banks wrote: I mean in general. I wouldn't spell it like that. I would prefer if empty(x), with an __empty__ method. (And support __nonzero__ aka __bool__ dropped completely.) So your argument is purely about style, then. You just wish it were written differently. -- Erik Max Franc

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
Russ P. wrote: Oh, Lordy. I understand perfectly well how boolean tests, __len__, and __nonzero__ work in Python. It's very basic stuff. You can quit patronizing me (and Carl too, I'm sure). You suggested a syntax for testing non-emptiness (`x is not empty`) which indicated a profound misunde

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Ethan Furman
Russ P. wrote: Oh, Lordy. I understand perfectly well how boolean tests, __len__, and __nonzero__ work in Python. It's very basic stuff. You can quit patronizing me (and Carl too, I'm sure). The point that you seem to be missing, or refuse to acknowledge for some reason, is that "if x" can be m

Re: static variables in Python?

2008-07-30 Thread Alan Franzoni
kj was kind enough to say: > In this case, foo is defined by assigning to it a closure that has > an associated variable, $x, in its scope. > > Is there an equivalent in Python? There've been plenty of answers, and I'm not absolutely sure about what you want... but closures are available in Pyth

Correct Attribute Assignment Methodology?

2008-07-30 Thread Tim Cook
Say I have these classes: class Parent(object): """Parent is abstract""" a=None def showA(): return self.a class Child(Parent): """inherits a and showA from Parent""" def __init__(self,a,b): self.a=a self.b=b def showAB(): return self.a,self.b class GrandChild(Chi

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Maric Michaud
Le Tuesday 29 July 2008 23:48:31 [EMAIL PROTECTED], vous avez écrit : > Here's a function, print_members.  It's just something that takes some > iterable and prints its members in XML.  It's special-cased so that an > empty iterable gets an empty tag.  (This is a bit of a trivial > example, I admit

Re: Python parsing iTunes XML/COM

2008-07-30 Thread pyshib
If you want to convert the file names which use standard URL encoding (with %20 for space, etc) use: from urllib import unquote new_filename = unquote(filename) I have found this does not convert encoded characters of the form '&#CC;' so you may have to do that manually. I think these are just as

Re: Change PC to Win or Windows

2008-07-30 Thread Antoon Pardon
On 2008-07-21, Derek Martin <[EMAIL PROTECTED]> wrote: > > --tsOsTdHNUZQcU9Ye > Content-Type: text/plain; charset=iso-8859-1 > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Sat, Jul 19, 2008 at 02:56:07AM -0700, Lie wrote: >> On Jul 19, 6:14=A0am, Derek Martin <[E

Re: proxy class and __add__ method

2008-07-30 Thread Magnus Schuster
>__magic__ methods on new style classes are searched in the class, *not* in >the instance. prx_i+1 looks for __add__ in type(prx_i), that is, in the >proxy class. With this explanation the behaviour is absolutely clear. Can I find some documentation anywhere containing more background inform

Python Modules To convert PDF files to HTML files

2008-07-30 Thread srinivasan srinivas
Hi, could someone tel me any python modules which can be used to convert PDF files to HTML files?? Thanks, Srini Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Continuous integration for Python projects

2008-07-30 Thread BlueBird
On Jul 29, 4:56 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Hussein B wrote: > > Hi. > > Please correct my if I'm wrong but it seems to me that the major > > continuous integration servers (Hudson, CruiseControl, TeamCity ..) > > don't support Python based application. > > It seems they mai

variable expansion with sqlite

2008-07-30 Thread marc wyburn
Hi I'm using SQlite and the CSV module and trying to create a class that converts data from CSV file into a SQLite table. My script curently uses functions for everything and I'm trying to improve my class programming. The problem I'm having is with variable expansion. self.cursor.executemany('I

Re: Proxy server?

2008-07-30 Thread Gary
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Gary schrieb: > > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > You can't make any TCP/IP communication run through a proxy, unless it's > transparent. Thanks for all the info.

Re: variable expansion with sqlite

2008-07-30 Thread Tim Golden
marc wyburn wrote: Hi I'm using SQlite and the CSV module and trying to create a class that converts data from CSV file into a SQLite table. My script curently uses functions for everything and I'm trying to improve my class programming. The problem I'm having is with variable expansion. self.

Re: Continuous integration for Python projects

2008-07-30 Thread Alan Franzoni
Hussein B was kind enough to say: > Hi. > Please correct my if I'm wrong but it seems to me that the major > continuous integration servers (Hudson, CruiseControl, TeamCity ..) > don't support Python based application. If you want, you can use ant as a build script, and then define the usual targ

Re: Defunct when using subprocess.Popen

2008-07-30 Thread Bruce Frederiksen
On Wed, 30 Jul 2008 01:56:28 -0300, Gabriel Genellina wrote: > You should call os.waitpid() after killing the child process, to let the > OS free the resources allocated to it. > The subprocess.Popen object supports a 'wait' method directly. -- http://mail.python.org/mailman/listinfo/python-lis

Re: Proxy server?

2008-07-30 Thread Heiko Wundram
Am Mittwoch, 30. Juli 2008 13:48:08 schrieb Gary: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > Gary schrieb: > > > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > You can't make any TCP/IP communication run thr

Re: Insert character at a fixed position of lines

2008-07-30 Thread Lie
On Jul 27, 10:02 am, alex23 <[EMAIL PROTECTED]> wrote: > Ugh, and in pointing our your inaccurate code I posted my own: > > > >>> f = open('dummy.txt','w') > > >>> f.write(line = 'this doesn't work') > > >   File "", line 1 > >     f.write(line = 'this doesn't work') > >                            

Standard module for parsing emails?

2008-07-30 Thread Phillip B Oldham
Is there a standard library for parsing emails that can cope with the different way email clients quote? -- http://mail.python.org/mailman/listinfo/python-list

Re: elementtree and rounding questions

2008-07-30 Thread jyoung79
Thank you very much Gabriel and Stefan for your help! I really appreciate the excellent examples you've shared which is helping me understand how all this works. Again, thank you for taking the time to help me with this. Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard module for parsing emails?

2008-07-30 Thread Diez B. Roggisch
Phillip B Oldham wrote: > Is there a standard library for parsing emails that can cope with the > different way email clients quote? AFAIK not - as unfortunately that's something the user can configure, and thus no atrocity is unimaginable. Hard to write a module for that... All you can try is t

Re: Build tool for Python

2008-07-30 Thread Sion Arrowsmith
Hussein B <[EMAIL PROTECTED]> wrote: >Apache Ant is the de facto building tool for Java (whether JSE, JEE >and JME) application. >With Ant you can do what ever you want: [ ... ] ... bash your head against your desk for hours trying to make sense of its classloader system, struggle for days on end

Re: variable expansion with sqlite

2008-07-30 Thread Gerhard Häring
Tim Golden wrote: marc wyburn wrote: Hi I'm using SQlite and the CSV module and trying to create a class that converts data from CSV file into a SQLite table. My script curently uses functions for everything and I'm trying to improve my class programming. The problem I'm having is with variabl

Re: Standard module for parsing emails?

2008-07-30 Thread Ben Finney
Phillip B Oldham <[EMAIL PROTECTED]> writes: > Is there a standard library for parsing emails that can cope with > the different way email clients quote? "Cope with" in what sense? i.e., what would the behaviour of such a library be? What would it do? Note also that it's not merely the mail clie

Re: variable expansion with sqlite

2008-07-30 Thread Tim Golden
Gerhard Häring wrote: My code would probably look very similar. Btw you don't need to use list() on an iterable to pass to executemany(). pysqlite's executemany() accepts anything iterable (so generators work fine, too). Thanks for that. My finger-memory told me to do that, possibly because so

Re: Native Code vs. Python code for modules

2008-07-30 Thread Sion Arrowsmith
alex23 <[EMAIL PROTECTED]> wrote: >On Jul 30, 1:56=A0pm, koblas <[EMAIL PROTECTED]> wrote: >> Ruby has been getting pummeled for the last year or more on the >> performance subject. =A0They've been working hard at improving it. =A0Fro= >m >> my arm chair perspective Python is sitting on it's laure

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread giltay
On Jul 30, 5:09 am, Maric Michaud <[EMAIL PROTECTED]> wrote: > Le Tuesday 29 July 2008 23:48:31 [EMAIL PROTECTED], vous avez écrit : > > def print_members(iterable): > >     if not iterable: > >         print '' > >         return > >     print '' > >     for item in iterable: > >         print '%s

Re: Standard module for parsing emails?

2008-07-30 Thread Thomas Guettler
Phillip B Oldham schrieb: Is there a standard library for parsing emails that can cope with the different way email clients quote? What do you mean with "quote" here? 1. Encode utf8/latin1 to ascii 2. Prefix of quoted text like your text above in my mail Thomas -- Thomas Guettler, http://

Re: iterating "by twos"

2008-07-30 Thread giltay
On Jul 29, 4:11 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > for x, y in zip(a, a[1:]): > >     frob(x, y) > > What you meant was this: > >  >>> [(x, y) for x, y in zip(a[::2], a[1::2])] > [(0, 1), (2, 3), (4, 5), (6, 7), (8, 9)] > > but this creates three sublists

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Hyuga
On Jul 30, 3:53 am, "Russ P." <[EMAIL PROTECTED]> wrote: > Fair enough. I have no dog in this particular fight. I just think it > wouldn't hurt to add an "isempty()" or "isnonempty()" method to the > list type, and let people use it if they wish, or continue using "if > x" if that's what they prefe

Re: Standard module for parsing emails?

2008-07-30 Thread Phillip B Oldham
On Jul 30, 2:36 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > What do you mean with "quote" here? > 2. Prefix of quoted text like your text above in my mail Basically, just be able to parse an email into its actual and "quoted" parts - lines which have been prefixed to indent from a previous

New CMS in Python

2008-07-30 Thread :-)
HI I am Glad to announce you that I am creating New CMS for Python. I'll post it after Python 3 release. Currently I only the Developer/Team Lead/Project Lead/Organization :) It would be Very lightweight Fast Easy to Use Ajax Enabled new?? Done. Please send me how U expect your new CMS would

Re: Native Code vs. Python code for modules

2008-07-30 Thread pruebauno
On Jul 29, 11:56 pm, koblas <[EMAIL PROTECTED]> wrote: > better if there was a way that if I have an "interface compatible" > native (aka C) module that has better performance that there could be > a way that python would give it preference. > > e.g. > > import random(version=1.2, lang=c) > or >

Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Simon Willison
I'm having a horrible time trying to get xml.dom.pulldom to consume a UTF8 encoded XML file. Here's what I've tried so far: >>> xml_utf8 = """ Simon\xe2\x80\x99s XML nightmare """ >>> from xml.dom import pulldom >>> parser = pulldom.parseString(xml_utf8) >>> parser.next() ('START_DOCUMENT', ) >>>

SVN access with pysvn under Cygwin (Installation problems)

2008-07-30 Thread Andy Dingley
I'm building Python tools to wrap up access to our Subversion / SVN source control system. It's to run on my desktop (Cygwin under Windows XP) and then later under Redhat. Trying to install the pysvn module I'm running into problems getting it to work under Cygwin. Works fine from a Windows comman

Pointers/References in Python?

2008-07-30 Thread [EMAIL PROTECTED]
Hello, I have a long list of memory-heavy objects that I would like to access in differently sorted order. Let's say I'd like to have lists called by_date or by_size that I can use to access the objects in the specified order. Of course I can just build those lists naively by creating copies of t

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Maric Michaud
Le Wednesday 30 July 2008 15:31:28 [EMAIL PROTECTED], vous avez écrit : > > > class Signal: > > >     [...] > > >     def dc_offset(self, amount): > > >         if amount == 0: > > >             return > > >         self.samples = [sample + amount for sample in self.samples] > > > > This function i

undo a dictionary

2008-07-30 Thread mmm
I found code to undo a dictionary association. def undict(dd, name_space=globals()): for key, value in dd.items(): exec "%s = %s" % (key, repr(value)) in name_space So if i run >>> dx= { 'a':1, 'b': 'B'} >>> undict(dx) I get >>> print A, B 1 B Here, a=1 and b='B' This works well

Re: Python parsing iTunes XML/COM

2008-07-30 Thread william tanksley
Thank you for the response. Here's some more info, including a little that you didn't ask me for but which might be useful. John Machin <[EMAIL PROTECTED]> wrote: > william tanksley <[EMAIL PROTECTED]> wrote: > > To ask another way: how do I convert from a file:// URL to a local > > path in a stan

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Terry Reedy
Carl Banks wrote: That's not what I was asking for. I was asking for a use case for "if x" that can't be replaced by a simple explicit test. Your example didn't satisfy that. But I believe my example of an iterator with __bool__ but not with __len__ does. -- http://mail.python.org/mailm

Re: Pointers/References in Python?

2008-07-30 Thread Brian Blais
On Jul 30, 2008, at 10:46 , [EMAIL PROTECTED] wrote: Of course I can just build those lists naively by creating copies of the original list and then sorting them according to my wishes. But that would create huge memory overhead. If the list itself is not memory intensive, but only the objects

Re: Pointers/References in Python?

2008-07-30 Thread Brian Blais
On Jul 30, 2008, at 10:46 , [EMAIL PROTECTED] wrote: Of course I can just build those lists naively by creating copies of the original list and then sorting them according to my wishes. But that would create huge memory overhead. If the list itself is not memory intensive, but only the objects

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Matthew Fitzgibbons
Carl Banks wrote: On Jul 30, 1:58 am, "Russ P." <[EMAIL PROTECTED]> wrote: On Jul 29, 10:33 pm, Carl Banks <[EMAIL PROTECTED]> wrote: On Jul 30, 1:15 am, "Russ P." <[EMAIL PROTECTED]> wrote: Having said that, it would sure be nice to be able to write if myList is not empty: instead of if len(

Re: Python parsing iTunes XML/COM

2008-07-30 Thread Jerry Hill
On Wed, Jul 30, 2008 at 10:58 AM, william tanksley <[EMAIL PROTECTED]> wrote: > Here's one example. The others are similar -- they have the same > things that look like problems to me. > > "Buffett Time - Annual Shareholders\xc2\xa0L.mp3" > > Note some problems here: > > 1. This isn't Unicode; it's

Re: Is it allowed to use function results as default arguments ?

2008-07-30 Thread Terry Reedy
fred.haab wrote: Well, others have answered the question, but I thought I'd throw in that it would be more pythonic to do something like: def Get_Relative_Path(target, base = None): if base is None: base = os.curdir ... Since os.curdir is a constant, this is nonesensical. On

Re: Pointers/References in Python?

2008-07-30 Thread bearophileHUGS
boblatest: > I have a long list of memory-heavy objects that I would like to access > in differently sorted order. Let's say I'd like to have lists called > by_date or by_size that I can use to access the objects in the > specified order. Just create a new list with a different sorting order, for

Re: Standard module for parsing emails?

2008-07-30 Thread Phillip B Oldham
If there isn't a standard library for parsing emails, is there one for connecting to a pop/imap resource and reading the mailbox? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Simon Willison
Follow up question: what's the best way of incrementally consuming XML in Python that's character encoding aware? I have a very large file to consume but I'd rather not have to fall back to the raw SAX API. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pointers/References in Python?

2008-07-30 Thread Maric Michaud
Le Wednesday 30 July 2008 16:46:37 [EMAIL PROTECTED], vous avez écrit : > Hello, > > I have a long list of memory-heavy objects that I would like to access > in differently sorted order. Let's say I'd like to have lists called > by_date or by_size that I can use to access the objects in the > speci

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Matthew Fitzgibbons
Russ P. wrote: On Jul 30, 12:03 am, Heiko Wundram <[EMAIL PROTECTED]> wrote: Am Mittwoch, 30. Juli 2008 08:30:48 schrieb Russ P.: On Jul 29, 11:09 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: I'm getting this sneaking suspicion that you guys are all putting us on. As I said in an earlier

Re: undo a dictionary

2008-07-30 Thread Kay Schluehr
On 30 Jul., 16:51, mmm <[EMAIL PROTECTED]> wrote: > I found code to undo a dictionary association. > > def undict(dd, name_space=globals()): > for key, value in dd.items(): > exec "%s = %s" % (key, repr(value)) in name_space > > So if i run > > >>> dx= { 'a':1, 'b': 'B'} > >>> undict(dx

Re: Pointers/References in Python?

2008-07-30 Thread Gary Herron
[EMAIL PROTECTED] wrote: Hello, I have a long list of memory-heavy objects that I would like to access in differently sorted order. Let's say I'd like to have lists called by_date or by_size that I can use to access the objects in the specified order. Of course I can just build those lists naiv

Re: undo a dictionary

2008-07-30 Thread bockman
On 30 Lug, 16:51, mmm <[EMAIL PROTECTED]> wrote: > I found code to undo a dictionary association. > > def undict(dd, name_space=globals()): >     for key, value in dd.items(): >         exec "%s = %s" % (key, repr(value)) in name_space > > So if i run > > >>> dx= { 'a':1, 'b': 'B'} > >>> undict(dx)

Re: variable expansion with sqlite

2008-07-30 Thread marc wyburn
Hi and thanks, I was hoping to avoid having to weld qmarks together but I guess that's why people use things like SQL alchemy instead. It's a good lesson anyway. Thanks, Marc. On Jul 30, 2:24 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Gerhard Häring wrote: > > My code would probably look very

RE: interpreter vs. compiled

2008-07-30 Thread Dino Viehland
It looks like the pickle differences are due to two issues. First IronPython doesn't have ASCII strings so it serializes strings as Unicode. Second there are dictionary ordering differences. If you just do: { 'a': True, 'b': set( ) } Cpy prints: {'a': True, 'b': set([])} Ipy prints: {'b': se

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Paul Boddie
On 30 Jul, 16:32, Simon Willison <[EMAIL PROTECTED]> wrote: > I'm having a horrible time trying to get xml.dom.pulldom to consume a > UTF8 encoded XML file. Here's what I've tried so far: > > >>> xml_utf8 = """ > > Simon\xe2\x80\x99s XML nightmare > """>>> from xml.dom import pulldom > >>> parser =

ANN: Google custom search engine for Python

2008-07-30 Thread Gerard flanagan
What is it? --- A Google custom search engine which targets only the following sites: + `The Hazel Tree `__ + `The Python standard library docs `__ + `The Python wiki `__ + `Python Package Index

Re: Standard module for parsing emails?

2008-07-30 Thread Maric Michaud
Le Wednesday 30 July 2008 17:15:07 Phillip B Oldham, vous avez écrit : > If there isn't a standard library for parsing emails, is there one for > connecting to a pop/imap resource and reading the mailbox? > -- > http://mail.python.org/mailman/listinfo/python-list There are both shipped with python

Re: Standard module for parsing emails?

2008-07-30 Thread Aspersieman
Phillip B Oldham wrote: > If there isn't a standard library for parsing emails, is there one for > connecting to a pop/imap resource and reading the mailbox? > -- > http://mail.python.org/mailman/listinfo/python-list > > The search [1] yielded these results: 1) http://docs.python.org/lib/mod

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Simon Willison
On Jul 30, 4:43 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > I can't reproduce this on Python 2.3.6 or 2.4.4 on RHEL 4. Instead, I > get the usual... > > ('CHARACTERS', ) I'm using Python 2.5.1 on OS X Leopard: $ python Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13) [GCC 4.0.1 (Apple Inc. build

Re: Standard module for parsing emails?

2008-07-30 Thread Maric Michaud
Le Wednesday 30 July 2008 17:55:35 Aspersieman, vous avez écrit : > For parsing the mails I would recommend pyparsing. Why ? email module is a great parser IMO. -- _ Maric Michaud -- http://mail.python.org/mailman/listinfo/python-list

Re: interpreter vs. compiled

2008-07-30 Thread Terry Reedy
castironpi wrote: The current CPython VM does not compile code. CPython compiles Python code to bytecode for its CPython *hardware independent* VM using standard compiler methdods and tools (lexer, parser, code generator, and optimizer). That VM (interpreter) is written in portable-as-po

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Simon Willison
On Jul 30, 4:59 pm, Simon Willison <[EMAIL PROTECTED]> wrote: > I just tried it out on Python 2.4.2 on an Ubuntu machine and it worked > fine! I guess this must be an OS X Python bug. How absolutely > infuriating. Some very useful people in #python on Freenode pointed out that my bug occurs becaus

Re: Correct Attribute Assignment Methodology?

2008-07-30 Thread Terry Reedy
Tim Cook wrote: Say I have these classes: class Parent(object): """Parent is abstract""" a=None def showA(): return self.a class Child(Parent): """inherits a and showA from Parent""" def __init__(self,a,b): self.a=a self.b=b def showAB(): return self.a,self.b

Is there a such Python module ?

2008-07-30 Thread Johny
Is there a Python module that can help with reading SMS message from a mobile phone? Or is there an example how to read SMS message using a program written in Python,C, or any other language? Thank you very much for help L. -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Matthew Fitzgibbons
Carl Banks wrote: On Jul 29, 6:42 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: Carl Banks wrote: Much like in Steven D'Aprano's example, still the only actual code snippet I've seen, it seems that this can easily be done with a simple explicit test by having all no-advance filters return

Syntax error in my script

2008-07-30 Thread laredotornado
Hi, This might be more relevant for another group, but since this is a Python script, thought I'd start here. I'm trying to write a WLST script for WebLogic 9.2. I coped one directly from WebLogic's site (http://e-docs.bea.com/wls/docs90/config_scripting/ using_WLST.html#1078952), but I'm getting

Non Continuous Subsequences

2008-07-30 Thread bearophileHUGS
This post is not about practical stuff, so if you have little time, you may ignore it. This is a task of the rosettacode.org site: http://www.rosettacode.org/wiki/Non_Continuous_Subsequences A subsequence contains some subset of the elements of this sequence, in the same order. A continuous subse

Re: Pointers/References in Python?

2008-07-30 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Hello, I have a long list of memory-heavy objects that I would like to access in differently sorted order. Let's say I'd like to have lists called by_date or by_size that I can use to access the objects in the specified order. Of course I can just build those lists na

Reasoning behind 'self' parameter in classes?

2008-07-30 Thread Robert Dailey
Hi, I want to point out first of all that I'm not as familiar with Python as I should be, and for that reason I question a lot of things because I'm mainly a C++ programmer and I'm used to certain conveniences. Having said that... I've always been curious (more so than annoyed) as to why one must

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Paul Boddie
On 30 Jul, 18:17, Simon Willison <[EMAIL PROTECTED]> wrote: > > Some very useful people in #python on Freenode pointed out that my bug > occurs because I'm trying to display things interactively in the > console. Saving to a variable instead fixes the problem. What's strange about that is how the

Re: Is there a such Python module ?

2008-07-30 Thread Matthew Fitzgibbons
Johny wrote: Is there a Python module that can help with reading SMS message from a mobile phone? Or is there an example how to read SMS message using a program written in Python,C, or any other language? Thank you very much for help L. -- http://mail.python.org/mailman/listinfo/python-list Th

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Ethan Furman
Carl Banks wrote: On Jul 29, 6:42 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: I don't have any postable code (it's in a half way state and I haven't touched it for a while), but I'll see if I can't find the time to bang something up to give you the gist. I wouldn't bother at this point.

Re: Build tool for Python

2008-07-30 Thread Tim Arnold
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > Hussein B wrote: >> Hi. >> Apache Ant is the de facto building tool for Java (whether JSE, JEE >> and JME) application. >> With Ant you can do what ever you want: compile, generate docs, >> generate code, packing, depl

Interbase

2008-07-30 Thread Mike Hjorleifsson
Has anyone gotten python working with Interbase database platform ? I need to query some info from an interbase database on another server need a lil help getting started. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reasoning behind 'self' parameter in classes?

2008-07-30 Thread Matthew Fitzgibbons
Robert Dailey wrote: Hi, I want to point out first of all that I'm not as familiar with Python as I should be, and for that reason I question a lot of things because I'm mainly a C++ programmer and I'm used to certain conveniences. Having said that... I've always been curious (more so than

Re: like py2exe, but on a mac

2008-07-30 Thread William McBrine
On Tue, 29 Jul 2008 12:24:49 -0700, Russell E. Owen wrote: > That is exactly what py2app does by default if you run py2app with the > system python. Thanks. I see that it* avoids the issue with Tk starting in the background that I get with Platypus, too. In fact, it looks like the bundlebuilder

Re: undo a dictionary

2008-07-30 Thread Terry Reedy
mmm wrote: I found code to undo a dictionary association. def undict(dd, name_space=globals()): for key, value in dd.items(): exec "%s = %s" % (key, repr(value)) in name_space You are not undoing anything. You are updating globals() from another dict. But why repr(value)? Wit

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Peter Otten
Paul Boddie wrote: > On 30 Jul, 18:17, Simon Willison <[EMAIL PROTECTED]> wrote: >> >> Some very useful people in #python on Freenode pointed out that my bug >> occurs because I'm trying to display things interactively in the >> console. Saving to a variable instead fixes the problem. > > What's

Re: Standard module for parsing emails?

2008-07-30 Thread MRAB
On Jul 30, 3:11 pm, Phillip B Oldham <[EMAIL PROTECTED]> wrote: > On Jul 30, 2:36 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > > What do you mean with "quote" here? > >   2. Prefix of quoted text like your text above in my mail > > Basically, just be able to parse an email into its actual and

Re: Syntax error in my script

2008-07-30 Thread Alan Franzoni
laredotornado was kind enough to say: [cut] Indentation counts in Python. You're probably doing something wrong with whitespace/tab/carriage return. -- Alan Franzoni <[EMAIL PROTECTED]> - Remove .xyz from my email in order to contact me. - GPG Key Fingerprint: 5C77 9DC3 BD5B 3A28 E7BC 921A 02

Re: Standard module for parsing emails?

2008-07-30 Thread Diez B. Roggisch
Maric Michaud wrote: > Le Wednesday 30 July 2008 17:55:35 Aspersieman, vous avez écrit : >> For parsing the mails I would recommend pyparsing. > > Why ? email module is a great parser IMO. He talks about parsing the *content*, not the email envelope and possible mime-body. Diez -- http://mail.p

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Stefan Behnel
Simon Willison wrote: > Follow up question: what's the best way of incrementally consuming XML > in Python that's character encoding aware? iterparse(), as implemented in (c)ElementTree and lxml. Note that ElementTree and cElementTree are part of Python 2.5, in the xml.etree package. > I have a

Re: Syntax error in my script

2008-07-30 Thread laredotornado
On Jul 30, 11:26 am, Alan Franzoni <[EMAIL PROTECTED]> wrote: > laredotornadowas kind enough to say: > > [cut] > > Indentation counts in Python. You're probably doing something wrong with > whitespace/tab/carriage return. > > -- > Alan Franzoni <[EMAIL PROTECTED]> > - > Remove .xyz from my email in

Possible to have multiple loop variables?

2008-07-30 Thread laredotornado
I don't know why I thought this would work, but I would like to have 3 variables in my for loop per iteration. Those familiar will know that this ms1 = {'managed1':7019:8020,'managed2':7020:8021} for m, lp, ssl_lp in ms1.items(): managedServer = create(m,'Server') print 'creating mana

Re: Questions about asyncore

2008-07-30 Thread Giampaolo Rodola'
On 30 Lug, 09:49, Frank Millman <[EMAIL PROTECTED]> wrote: > On Jul 29, 3:40 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > On 29 Lug, 13:09, Frank Millman <[EMAIL PROTECTED]> wrote: > > Thanks for the reply, Giampaolo. Glad to help. > > The benefit of asynchat is that it automatically

Re: static variables in Python?

2008-07-30 Thread Rhamphoryncus
On Jul 29, 2:40 pm, kj <[EMAIL PROTECTED]> wrote: > Yet another noob question... > > Is there a way to mimic C's static variables in Python?  Or something > like it?  The idea is to equip a given function with a set of > constants that belong only to it, so as not to clutter the global > namespace

Re: Is it possible to consume UTF8 XML documents using xml.dom.pulldom?

2008-07-30 Thread Paul Boddie
On 30 Jul, 19:23, Peter Otten <[EMAIL PROTECTED]> wrote: > > I'm on Kubuntu 7.10 and see the same error as Simon. The problem is in the > minidom.CharacterData class which has the following method > >     def __repr__(self): >         data = self.data >         if len(data) > 10: >             dotd

Re: proxy class and __add__ method

2008-07-30 Thread Rhamphoryncus
On Jul 29, 10:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 29 Jul 2008 13:13:51 -0300, Magnus Schuster   > <[EMAIL PROTECTED]> escribi : > > > > > Hello, > > I have written the following small proxy class which I expect to pass all > > function calls to the 'original' object: > >

Re: Reasoning behind 'self' parameter in classes?

2008-07-30 Thread Brett g Porter
Robert Dailey wrote: This is an example of a response I'm looking for: "The self parameter is required because the parser is a bit old and needs to know the exact object you're referencing" This is _not_ an example of what I'm looking for: "Specifying self is a great mysterious thing that we

  1   2   >