[Tutor] listdir

Christopher Spears cspears2002 at yahoo.com
Sun Jan 11 23:42:29 EST 2004


I was trying to use listdir to look into the contents
of a file on my Win2K system.  According to the online
docs, I should be able to do this, but instead, I get
the following error message:

>>> import os
>>> listdir('C:\Documents and Settings\Christstopher
Spears\My Documents\python')

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in -toplevel-
    listdir('C:\Documents and Settings\Christstopher
Spears\My Documents\python')
NameError: name 'listdir' is not defined

What does this mean?  I have the same problem when I
try to rename a file.


=====
"I'm the last person to pretend that I'm a radio.  I'd rather go out and be a color television set."
-David Bowie

"Who dares wins"
-British military motto

"Far more creativity, today, goes into the marketing of products than into the products themselves..."
-"Pattern Recognition" by William Gibson



More information about the Tutor mailing list