[Tutor] ok, I want to read a dir.

Kirk Bailey deliberatus@my995internet.com
Wed, 26 Dec 2001 21:13:56 -0500


ok, it worked. Too well, it worked.

It returned the file names, and included in the return is the path!

Lookee:
ns# ./TLwebmgr.py
<HTML><HEAD>
 <STYLE TYPE="text/css">
 <!--  A { text-decoration: none; }  A:visited, A:hover, A:active 
text-decoration:none; }
 // --></STYLE>
 <TITLE>TinyList Web Manager</TITLE>
 </HEAD>
 <BODY TEXT="#000000"  BGCOLOR="#FFFFFF"  LINK="#0000FF" ALINK="FF0000"
VLINK="0000FF"><blockq>
 

['./lists/testlist3.info', './lists/tinylist-devlopers.info',
'./lists/evil-humor.info']
Here is the content of 'filelist': ['./lists/testlist3.info',
'./lists/tinylist-devlopers.info 

<P><br>
./lists/testlist3.info - A testing list for devlopment of TinyList
<P>
./lists/tinylist-devlopers.info The Devloper's discussion list for
Tinylist- TECHNICAL!
<P>
./lists/evil-humor.info EVIL HUMOR- sick, cynical, jaded, peverse,
howlingly funny! ADULTS ONL!
<P>
<P><br>Please click a name to read the entire description and to
 access the form to subscribe or subscribe.<P><br>
<P><br>
 </BODY>
 </HTML>

ns# 
See, those lines should be the bare name of the thing, a space, then the
firstline of the info file. Well, ir read the info file pretty slick.
Accessed the riretory structure just fine. Seems I want to massage the
elements in the list, or at least in A list, so everything but the first
part of the file is GONE. Strip off the path, then strip off the .info
part, leaving us with pure NAME. That name is the name of a list. That
btw is in my server now, and those are the info files for 3 lists NOW
working with TLpost.py NOW. snurklechortlegloat...

I love this list.


Danny Yoo wrote:
> 
> On Wed, 26 Dec 2001, Kirk Bailey wrote:
> 
> > I want to read a dir. I spedify a path and a name pattern, such as
> > '*.info', and read all examples of that pattern into a list.
> 
> Ah!  Take a look at the glob module:
> 
>     http://www.python.org/doc/lib/module-glob.html
> 
> Hope this helps!
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Respectfully,
             -Kirk D Bailey (C)2001
              Addme! icq #27840081
end


Within the sweep of his sword, Each man is an Ubar.

http://www.howlermonkey.net/
http://www.sacredelectron.org/