Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Splitting a line while keeping quoted items together

Reply
Thread Tools

Re: Splitting a line while keeping quoted items together

 
 
Tim Chase
Guest
Posts: n/a
 
      11-20-2012
>> Use the "shlex" module in the std lib?
>
> Well color me ignorant.
>
> Works cleanly. I shouldn't have reinvented the wheel.


I've experienced this enough: the csv module, option parsing,
config-file parsing, logging, timeit, and pwd all come to mind as
code I've written before realizing the stdlib already has it. Now,
if my task sounds remotely like something that somebody else might
have implemented already, my first stop is always to browse through
the stdlib docs. Then try http://pypi.python.org/pypi to see if
somebody else has already solved the problem without the solution
getting into the stdlib. Only then do I proceed to trying to code
up something of my own.

-tkc


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting a line while keeping quoted items together josh@merchantconcepts.com Python 1 11-20-2012 01:09 AM
Re: Splitting text at whitespace but keeping the whitespace in thereturned list MRAB Python 3 01-26-2010 11:36 PM
Problem while splitting the line using a delimiter and pushing itinto an array Prasanth C++ 4 11-22-2008 05:10 AM
Splitting string into array keeping delimiters Gary C40 Ruby 6 12-16-2007 10:46 AM
Splitting a quoted string. mosscliffe Python 5 05-16-2007 01:13 PM



Advertisments