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?
Steven D'Aprano ste...@remove.this.cybersource.com.au 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
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 stdin, line 1, in ?
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
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
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('(.*\\).*')
I get the error:
sre_constants.error: unbalanced parenthesis
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
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 PROTECTED]
I'm not sure one needs to start again with a naive approach
just
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 PROTECTED]
You might be interested in the Early parsing algorithm
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
yet.
Thank you.
How is it that I seem
Steven D'Aprano [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Wed, 07 Nov 2007 21:15:50 +, Just Another Victim of the Ambient
Morality wrote:
Why can't I find a pyparsing-esque library with this implementation?
I'm tempted to roll my own except that it's a fairly
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
news:[EMAIL PROTECTED]
On Nov 7, 2007 3:15 PM, Just Another Victim
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 other
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 PROTECTED]
Is there not an ambiguity in the grammar?
In EBNF:
goal
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 language '[ab]+b'.
goal -- ab_list 'b'
ab_list -- 'a' list_tail
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 PROTECTED]
I believe there's no cure for the confusion you're having except
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.
It's slow, obviously, but it's correct and, sometimes (arguably
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 PROTECTED]
On Nov 4, 10:44 pm, Just Another Victim of the Ambient Morality
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
recursive
descent parser any more than having a recursive
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:
It has recursion in it but that's not sufficient to call it a
recursive
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' and when
it
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')
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 protocol are you interested in, NNTP (for reading/posting
from
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
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
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 using is
somewhat
unorthodox. I need to be able to parse something
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 amp; don't get translated into
as one would
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 why.
First, it doesn't appear
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
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
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
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 parse very specific tags through object
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. There are
websites for which
36 matches
Mail list logo