Try this

Discussion in 'Python' started by RunLevelZero, Jul 24, 2005.

  1. RunLevelZero

    RunLevelZero Guest

    I'm not sure I understand your first question but checkout the " glob "
    module. Sounds like it may help.

    Here is how you could get the folders and filenames

    import os

    list = os.walk("C:\python24\Tools")
    for file in list:
    folderlist = os.path.split(file[0])
    print "****************Folder***************"
    print folderlist[1]
    print "====================================="
    print
    print "****************Files*****************"
    print file[2]
    print "====================================="
    RunLevelZero, Jul 24, 2005
    #1
    1. Advertising

  2. RunLevelZero wrote:
    > I'm not sure I understand your first question but checkout the " glob "
    > module. Sounds like it may help.


    Who are you talking to? It would help if you quoted text from the
    original message, left some of the original subject, and replied to the
    original message instead of making a new post.
    --
    Michael Hoffman
    Michael Hoffman, Jul 24, 2005
    #2
    1. Advertising

  3. RunLevelZero

    RunLevelZero Guest

    Indeed.. I did click reply but I guess I wasn't paying attention. My
    bad.
    RunLevelZero, Jul 25, 2005
    #3
  4. In the darkest hour on 24 Jul 2005 12:10:47 -0700,
    RunLevelZero <> screamed:
    > list = os.walk("C:\python24\Tools")


    r"C:\python24\Tools"

    Artur

    --
    [ Artur M. Piwko : Pipen : AMP29-RIPE : RLU:100918 : From == Trap! : SIG:230B ]
    [ 01:45:21 user up 10684 days, 13:40, 1 user, load average: 0.06, 0.06, 0.06 ]

    Backup not found: A)bort, R)etry, M)assive heart failure?
    Artur M. Piwko, Jul 26, 2005
    #4
    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. bienwell
    Replies:
    4
    Views:
    3,698
    bienwell
    May 27, 2005
  2. John Salerno
    Replies:
    20
    Views:
    809
    John Salerno
    Aug 11, 2006
  3. Fabio Z Tessitore

    who is simpler? try/except/else or try/except

    Fabio Z Tessitore, Aug 12, 2007, in forum: Python
    Replies:
    5
    Views:
    356
  4. =?Utf-8?B?QUo=?=

    When to TRY and not to TRY

    =?Utf-8?B?QUo=?=, Oct 16, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    314
    sloan
    Oct 17, 2007
  5. MRAB
    Replies:
    4
    Views:
    294
Loading...

Share This Page