globbing multiple wildcards

U

utabintarbo

I have a path spec similar to '/home/*/.mozilla/*/*/cache*/*' (this
will probably look familiar to *nix users) with multiple wildcards. I
am finding it difficult gathering ALL file pathnames which match this
spec. Can anyone shed some light on this for a python noob?

TIA
Bob
 
W

wittempj

what about :
martin@ubuntu:~$ python
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
['/home/martin/.mozilla/firefox/dem8d5eu.default/Cache/_CACHE_MAP_',
'/home/martin/.mozilla/firefox/dem8d5eu.default/Cache/_CACHE_001_',
..........
'/home/martin/.mozilla/firefox/dem8d5eu.default/Cache/66FA72F2d01',
'/home/martin/.mozilla/firefox/dem8d5eu.default/Cache/85F82253d01',
'/home/martin/.mozilla/firefox/dem8d5eu.default/Cache/CE3B4D9Cd01']
 
L

Leif K-Brooks

I have a path spec similar to '/home/*/.mozilla/*/*/cache*/*' (this
will probably look familiar to *nix users) with multiple wildcards. I
am finding it difficult gathering ALL file pathnames which match this
spec. Can anyone shed some light on this for a python noob?

import glob
glob.glob('/home/*/.mozilla/*/*/cache*/*')
 
U

utabintarbo

Is there any way to make this recursive? That is what I was looking
for.

Sorry I wasn't too clear before.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top