Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Try this

Reply
Thread Tools

Try this

 
 
RunLevelZero
Guest
Posts: n/a
 
      07-24-2005
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 "====================================="

 
Reply With Quote
 
 
 
 
Michael Hoffman
Guest
Posts: n/a
 
      07-24-2005
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
 
Reply With Quote
 
 
 
 
RunLevelZero
Guest
Posts: n/a
 
      07-25-2005
Indeed.. I did click reply but I guess I wasn't paying attention. My
bad.

 
Reply With Quote
 
Artur M. Piwko
Guest
Posts: n/a
 
      07-25-2005
In the darkest hour on 24 Jul 2005 12:10:47 -0700,
RunLevelZero <(E-Mail Removed)> 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?
 
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
who is simpler? try/except/else or try/except Fabio Z Tessitore Python 5 08-13-2007 12:52 AM
converting a nested try/except statement into try/except/else John Salerno Python 20 08-11-2006 02:48 PM
Can I have a second TRY inside the first TRY/CATCH in ASP.NET ??? bienwell ASP .Net 4 05-27-2005 05:05 PM
Compiler error occurred when try to use a flexible template expression in preprocessor definesCompiler error occurred when try to use a flexible template expression in preprocessor defines snnn C++ 6 03-14-2005 04:09 PM
Try, Try, Try, again... Rick12N4@netscape.net Computer Support 3 01-29-2005 04:02 PM



Advertisments