[Tutor] a way to glob over http?

John Washakie washakie at gmail.com
Thu Apr 26 16:19:03 CEST 2007


Hello all,

I'm writing a program which take input about a path. The path may be
http or absolute or local. Once I have the path, I want to search the
directory for images (type also defined by user), then get a count on
the number of images in order to build the rest of my program:

searchPath = imageRoot + '*' + imgExt
avail = glob.glob(searchPath)  #will glob work over http?

One option would be to preform some testing first to see if the user
has input a local or http path, then I could use urllib I guess? (I am
not familiar with this yet). However, another concern arises in that
some directories on http servers are not readable, even if a readable
image is located in them... but that's another question for another
time.

Thanks,
john


More information about the Tutor mailing list