I've struggled with this for quite a while and I'm am just not sure
what is going on. I have the following code
import os
def buildList( directory='/Users/mkonrad' )
dirs = [ ]
listing = os.listdir(dire ctory)
for x in listing:
if os.path.isdir(x ):
dirs.append(x)
return dirs
This always returns an empty list.
Now if I change it so that directory='.' or directory=os.ge tcwd()
Then it returns a list of directories.
Any ideas?
Thank you,
-Michael
what is going on. I have the following code
import os
def buildList( directory='/Users/mkonrad' )
dirs = [ ]
listing = os.listdir(dire ctory)
for x in listing:
if os.path.isdir(x ):
dirs.append(x)
return dirs
This always returns an empty list.
Now if I change it so that directory='.' or directory=os.ge tcwd()
Then it returns a list of directories.
Any ideas?
Thank you,
-Michael
Comment