loop over files in a directory
|
| View previous topic :: View next topic |
| Author |
Message |
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
| How do I loop over files in a directory? |
| |
|
|
|
|
WarChild
Joined: 24 Feb 2006 Posts: 46
|
| Recursively or not? |
| |
|
|
Gladis
Joined: 24 May 2006 Posts: 108
|
| os.listdir or os.walk |
| |
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
Aha
If I have a string, like rubbishGOODblah and I want to extract just the GOOD with a regular expression, can I do it in one line?
Ie string = re.compile('(GOOD)').match ? |
| |
|
|
BigDaddy
Joined: 26 May 2006 Posts: 147
|
If you know the exact string you want to extract, just use that ...
String = 'GOOD'
Or am I being too simplistic |
| |
|
|
Guest
|
| Lusis Backwood JR wrote: |
Aha
If I have a string, like rubbishGOODblah and I want to extract just the GOOD with a regular expression, can I do it in one line?
Ie string = re.compile('(GOOD)').match ? |
match what? You have to show where to look for the info you want to match. |
| |
|
|
|
|