On May 16, 8:51 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
> How is the code different from shlex.split?
Shlex only splits by whitespace. I needed something to split out SQL
statements from a Postgresql dump, so the ideal way of doing that is
to split by semicolons. However, postgresql fun
"Ondrej Baudys" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> After trawling through the archives for a simple quote aware split
> implementation (ie string.split-alike that only splits outside of
> matching quote) and coming up short, I implemented a quick and dirty
> fun
On May 16, 10:50 am, "Ondrej Baudys" <[EMAIL PROTECTED]> wrote:
> # last slice will be of the form chars[last:] which we couldnt do above
Who are "we"? Here's another version with the "couldn't do" problem
fixed and a few minor enhancements:
def qsplit2(chars, sep=",", quote="'"):
""" Qu
How is the code different from shlex.split?
--
mvh Björn
--
http://mail.python.org/mailman/listinfo/python-list
Ondrej Baudys wrote:
> Hi,
>
> After trawling through the archives for a simple quote aware split
> implementation (ie string.split-alike that only splits outside of
> matching quote) and coming up short, I implemented a quick and dirty
> function that suits my purposes.
Maybe using the csv m
On May 16, 1:18 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> The "is" operator checks object *identity*, that is, if both operands are
> actually the same object. It may or may not work here, depending on many
> implementation details. You really should check if they are *equal*
> instead:
En Tue, 15 May 2007 21:50:15 -0300, Ondrej Baudys <[EMAIL PROTECTED]>
escribió:
> After trawling through the archives for a simple quote aware split
> implementation (ie string.split-alike that only splits outside of
> matching quote) and coming up short, I implemented a quick and dirty
> funct