Re: [OT] Re: output from external commands

Discussion in 'Python' started by Terry Hancock, Oct 25, 2005.

  1. On Monday 24 October 2005 09:04 pm, darren kirby wrote:
    > quoth the Fredrik Lundh:
    > > (using either on the output from glob.glob is just plain silly, of course)

    >
    > Silly? Sure. os.listdir() is more on point. Never said I was the smartest.
    > However, I will defend my post by pointing out that at the time it was the
    > only one that actually included code that did what the OP wanted.


    I think Mr. Lundh's point was only that the output from glob.glob is already
    guaranteed to be strings, so using either '%s'%f or str(f) is superfluous.

    --
    Terry Hancock ( hancock at anansispaceworks.com )
    Anansi Spaceworks http://www.anansispaceworks.com
    Terry Hancock, Oct 25, 2005
    #1
    1. Advertising

  2. Terry Hancock

    Mike Meyer Guest

    Terry Hancock <> writes:
    > I think Mr. Lundh's point was only that the output from glob.glob is already
    > guaranteed to be strings, so using either '%s'%f or str(f) is superfluous.


    Just for the record - this was why I asked what the point was in the
    first place.

    <mike
    --
    Mike Meyer <> http://www.mired.org/home/mwm/
    Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
    Mike Meyer, Oct 25, 2005
    #2
    1. Advertising

  3. On Tue, 25 Oct 2005 10:10:39 -0500, Terry Hancock <> wrote:

    >On Monday 24 October 2005 09:04 pm, darren kirby wrote:
    >> quoth the Fredrik Lundh:
    >> > (using either on the output from glob.glob is just plain silly, of course)

    >>
    >> Silly? Sure. os.listdir() is more on point. Never said I was the smartest.
    >> However, I will defend my post by pointing out that at the time it was the
    >> only one that actually included code that did what the OP wanted.

    >
    >I think Mr. Lundh's point was only that the output from glob.glob is already
    >guaranteed to be strings, so using either '%s'%f or str(f) is superfluous.
    >

    And so is a listcomp that only reproduces the list returned by glob.glob
    -- especially by iterating through that same returned list ;-)

    Regards,
    Bengt Richter
    Bengt Richter, Oct 26, 2005
    #3
    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. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    3,967
    Thomas Stegen
    Jun 28, 2003
  2. Avi Kak
    Replies:
    4
    Views:
    433
    Fernando Perez
    Jul 26, 2004
  3. James Colannino

    output from external commands

    James Colannino, Oct 24, 2005, in forum: Python
    Replies:
    2
    Views:
    289
    James Colannino
    Oct 24, 2005
  4. darren kirby

    Re: output from external commands

    darren kirby, Oct 24, 2005, in forum: Python
    Replies:
    6
    Views:
    377
    Fredrik Lundh
    Oct 24, 2005
  5. darren kirby

    [OT] Re: output from external commands

    darren kirby, Oct 25, 2005, in forum: Python
    Replies:
    2
    Views:
    336
    Tony Meyer
    Oct 25, 2005
Loading...

Share This Page