hi drost,
thanks once again for the suggestion
i once again tried your suggestion like this :looking for two text files created in C:\\Documents and Settings
import glob
location= "C:\\Documents and Settings"
particularext=glob.glob(location+r'\*.txt')
particularext.extend(glob.glob(location+r'\*.html'))
the run doesnt give me any results ? does it have any other missing element?
thanks somuch for your patience ,
som
This message was edited by Drost at 2004-9-10 3:18:57
: :
: : thanks drost
: : glob seems to specific to Unix , i tried this in my NT m/c it doesnt give any results, although no errors are thrown, can u pl try this?:
: :
: : i tried this :
: : import glob
: : location="C:\tsm_images\TSM_BA_Client"
: : particularext=glob.glob(location+'*.txt')
: : particularext.extend(glob.glob(location+'*.html'))
: : i doesnt give any results for any folder or any existing file extension.
: :
:
: Glob works on windows but be aware that to use pathstrings on windows you need to use either raw strings or double your slashes so that you don't trigger the escape character meaning of single slashes (\t means tab, etc.)...
: So your location should be like
:
:
: location = r"C:\tsm_images\TSM_BA_Client"
: -----------!
: or
:
: location = "C:\\tsm_images\\TSM_BA_Client"
: --------------!-----------!
:
:
: But then the rest needs the following correction (my fault). Strings don't like odd number of slashes at the end...
:
:
: particularext=glob.glob(location + r'\*.txt')
: particularext.extend(glob.glob(location + r'\*.html')
:
:
: Drost
:
:
: