I'm desperately trying to declare an adjacency list table with
declarative_base() but I can't figure it out. Strangely, all the
documentation avoids declarative_base() like the plague and does everything
the hard way. What the hell is this thing for if we're not supposed to use
it?
If
"Steven D'Aprano" wrote in message
news:pan.2009.08.04.09.28...@remove.this.cybersource.com.au...
> On Tue, 04 Aug 2009 10:03:53 +0200, Bruno Desthuilliers wrote:
>
>>> Disadvantages: your code is filled with line noise. It's an arbitrary
>>> choice between @@ meaning instance attribute and @@ m
I'm confused by this behaviour:
import re
regex = re.compile('foo')
match = regex.match('whatfooever')
In my experience with regular expressions, regex should have found a
match. However, in this case regex.match() returns None. Why is that?
What am I missing?
Thank you...
-
I'm trying to write a Python program that manipulates a MySQL database
and have chosen to use MySQLdb. So, I used by system's package manager,
YUM, and it appeared to install correctly. So, I tried it out and got this
error:
Traceback (most recent call last):
File "", line 1, in ?
Fi
I'm excited to use Python 3.0 (foolishly, it's the only Python
interpreter I have on my system) but there are no libraries for it beyond
the kitchen sink. Personally, a good start would be Beautiful Soup and
Mechanize. I could also use DB.
Has there been any word on Beautiful Soup?
I'm looking for a linked list implementation. Something iterable with
constant time insertion anywhere in the list. I was wondering if deque() is
the class to use or if there's something else. Is there?
Thank you...
--
http://mail.python.org/mailman/listinfo/python-list
It may sound like a strange question but that's probably only because I
don't know the proper terminology. I have an iterable object, like a list,
and I want to perform a transform on it (do an operation on each of the
elements) and then pass it onto something else that expects and iterable
"Paul Hankin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 27, 3:48 pm, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]> wrote:
>> This won't compile for me:
>>
>> regex = re.compile(
This won't compile for me:
regex = re.compile('(.*\\).*')
I get the error:
sre_constants.error: unbalanced parenthesis
I'm running Python 2.5 on WinXP. I've tried this expression with
another RE engine in another language and it works just fine which leads me
to believe the p
I've done a google search on this but, amazingly, I'm the first guy to
ever need this! Everyone else seems to need the reverse of this. Actually,
I did find some people who complained about this and rolled their own
solution but I refuse to believe that Python doesn't have a built-in
solu
"Chris Mellon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 7, 2007 5:15 PM, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>>
>> "Chris Mellon" <[EMAIL PROTECTED]> wrote in message
>
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wed, 07 Nov 2007 21:15:50 +0000, Just Another Victim of the Ambient
> Morality wrote:
>
>> Why can't I find a pyparsing-esque library with this implementation?
>>
"Chris Mellon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 7, 2007 3:15 PM, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>
>> > In short, it hasn't really evovled into a user-friendly package
&g
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-07, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PRO
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-05, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>> "Kay Schluehr" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PRO
How do you change certain elements in a list? I'm looking to do the
Python equivalent of this Ruby code:
-> first = [1, 2]
=> [1, 2]
-> second = first
=> [1, 2]
-> first.map! {|i| i + 1}
=> [2, 3]
-> first
=> [2, 3]
-> second
=> [2, 3]
I need to change a list, in place, so o
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-05, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>>
>> "Kay Schluehr" <[EMAIL PROTECTED]> wrote in message
>> news:
"Kay Schluehr" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 4, 10:44 pm, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]>
>
>> I believe there is a cure and it's called recursive descent parsing.
>
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-04, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PR
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-04, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>>> Consider writing a recursive decent parser by hand to parse
>>> the l
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-04, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>>
>> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
>> n
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-03, Paul McGuire <[EMAIL PROTECTED]> wrote:
>> On Nov 3, 12:33 am, "Just Another Victim of the Ambient Morality"
>><[EMAIL PROTECTED]> wrote:
>>>
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 3, 12:33 am, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]> wrote:
>> It has recursion in it but that's not sufficient to call it a
>
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 2, 5:47 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>>
>> Pyparsing is no recursive descent parser. It doesn't go back in the
>> input
>> stream. The ``OneOrMore(Word(alphas))`` part "eats" the 'end
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-10-30, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>
>> Is there a Python library to communicate with a usenet server?
>
> Which protoc
Is pyparsing really a recursive descent parser? I ask this because
there are grammars it can't parse that my recursive descent parser would
parse, should I have written one. For instance:
from pyparsing import *
grammar = OneOrMore(Word(alphas)) + Literal('end')
grammar.parseString('Firs
Is there a Python library to communicate with a usenet server? I did a
bit of googling and found some sites that suggest that you can roll your own
fairly easily but, mostly, I got a lot of false positives with talk of
Python libraries on usenet and I am really hoping this work has already
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Oct 22, 4:18 am, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]> wrote:
>> I'm trying to parse with pyparsing but the grammar I'm usin
I'm trying to parse with pyparsing but the grammar I'm using is somewhat
unorthodox. I need to be able to parse something like the following:
UPPER CASE WORDS And Title Like Words
...into two sentences:
UPPER CASE WORDS
And Title Like Words
I'm finding this surprisingly hard to do
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Just Another Victim of the Ambient Morality schrieb:
>> HTMLParser is behaving in, what I find to be, strange ways and I
>> would like to better understand what it is doing and w
HTMLParser is behaving in, what I find to be, strange ways and I would
like to better understand what it is doing and why.
First, it doesn't appear to translate HTML escape characters. I don't
know the actual terminology but things like & don't get translated into
& as one would like.
I can't seem to get VideoCapture (http://videocapture.sourceforge.net/)
to work with my version of Python (2.5). Why is that? I've followed the
instructions which made it look easy but, as it happens all too often, it
simply doesn't work. The error I get is that the .py interface file can
I need a red-black tree in Python and I was wondering if there was one
built in or if there's a good implementation out there. Something that,
lets face it, does whatever the C++ std::map<> allows you to do...
Thank you...
--
http://mail.python.org/mailman/listinfo/python-list
"Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote
in message news:[EMAIL PROTECTED]
>
>Okay, I think I found what I'm looking for in HTMLParser in the
> HTMLParser module.
Except it appears to be buggy or, at least, not very robust.
"Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote
in message news:[EMAIL PROTECTED]
>I'm trying to parse HTML in a very generic way.
>So far, I'm using SGMLParser in the sgmllib module. The problem is
> that it forces you to pars
I'm trying to parse HTML in a very generic way.
So far, I'm using SGMLParser in the sgmllib module. The problem is that
it forces you to parse very specific tags through object methods like
start_a(), start_p() and the like, forcing you to know exactly which tags
you want to handle. I
36 matches
Mail list logo