Re: Splitting a line while keeping quoted items together

Discussion in 'Python' started by Tim Chase, Nov 20, 2012.

  1. Tim Chase

    Tim Chase Guest

    >> 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
    Tim Chase, Nov 20, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nik Coughin
    Replies:
    2
    Views:
    586
    Jeff Thies
    Jul 28, 2004
  2. Fons Rave

    Keeping words together

    Fons Rave, May 9, 2006, in forum: HTML
    Replies:
    16
    Views:
    7,668
    Fons Rave
    May 10, 2006
  3. mosscliffe

    Splitting a quoted string.

    mosscliffe, May 16, 2007, in forum: Python
    Replies:
    5
    Views:
    309
    Gerard Flanagan
    May 16, 2007
  4. CBlair1986
    Replies:
    4
    Views:
    127
    CBlair1986
    Nov 18, 2006
  5. Replies:
    1
    Views:
    146
    Steven D'Aprano
    Nov 20, 2012
Loading...

Share This Page