[Tutor] Re: listdir()

Lee Harr missive at hotmail.com
Fri Jul 2 11:34:46 EDT 2004


>I have recently learnt of the os.listdir() function, and I intend to
>experiment with it using a cgi-page (html). I would like to have a base
>directive show all the files and folders, so that the user can browse
>through it all.
>


>But for now I was wondering if there is a simpler way to do? like an
>built in function...
>


I guess it depends on what your purpose is... but I would say
the simplest way to do it would be to install twisted python and
then ...


>mkdir foo
>mkdir foo/bar
>touch foo/abc
>touch foo/bar/defg
>mktap web --port 8888 --path foo
>twistd -f web.tap

Then point your browser at http://localhost:8888/

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus




More information about the Tutor mailing list