[Tutor] Newbie question.

alan.gauld@bt.com alan.gauld@bt.com
Mon, 27 May 2002 14:41:54 +0100


> I'm trying to use the os.listdir module to list a directory 

So you need to import os:

import os

And reference it when using listdir():

os.listdir()


> and then store that output to a list. 
> I'm probably doing this wrong:
> 
import os 
X = os.listdir("/")	# and the path should be a string

> How do I accomplish this? Sorry if this question is too newbyish.

Nothing is too newbyish for this list...

Alan g.