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.
snip/
Maybe using the csv
How is the code different from shlex.split?
--
mvh Björn
--
http://mail.python.org/mailman/listinfo/python-list
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='):
Quote aware split
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
function
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
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 supports
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
function
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: