Hi,
I have a super-simple need to just walk the files in a single directory.
I thought this would do it, but "permanentFilel ist" ends up containing
all folders in all subdirectories.
Could someone spot the problem? I've scoured some threads using XNews reg
expressions involving os.walk, but couldn't extrapolate the answer for my
need.
=============== =============== =============== ==
thebasedir = "E:\\temp"
permanentFileli st= []
for thepath,thedirn ames,thefilenam es in os.walk(thebase dir):
if thepath != thebasedir:
thedirnames[:] = []
for names in thefilenames:
permanentFileli st.append(names )
I have a super-simple need to just walk the files in a single directory.
I thought this would do it, but "permanentFilel ist" ends up containing
all folders in all subdirectories.
Could someone spot the problem? I've scoured some threads using XNews reg
expressions involving os.walk, but couldn't extrapolate the answer for my
need.
=============== =============== =============== ==
thebasedir = "E:\\temp"
permanentFileli st= []
for thepath,thedirn ames,thefilenam es in os.walk(thebase dir):
if thepath != thebasedir:
thedirnames[:] = []
for names in thefilenames:
permanentFileli st.append(names )
Comment