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,
enhancements:
def qsplit2(chars, sep=",", quote="'"):
""" Quote aware split """
assert sep != quote
can_split = True
splitpoints = [-1] # ie. separator char found before first
letter ;)
for index, c in enumerate(
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.
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
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.
It's ugly and it doesn't use a stack, it only