Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Recommended Answers
Jump to PostSorry about the earlier post. I realized what the problem was and I wanted to think about it for a while. Here is the question. How do I "negate" the effect of a "[" or "]" in a file name when I am doing globbing. For example, if my code …
Jump to PostI did it slightly differently but same, without re (you loose the special meaning of [] though, so I added -e flag for exact replacement for []):
import glob import sys # use -e flag to replace [] pattern = ''.join(c if c not in '[]' else …
All 8 Replies
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
TrustyTony
888
pyMod
Team Colleague
Featured Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.