Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Manipulate Files And Directory Easily With Path.py (on Pys60)

DZone's Guide to

Manipulate Files And Directory Easily With Path.py (on Pys60)

·
Free Resource
I really like Jason Orendorff's path.py.
So, I modify it a bit to use with pys60.
- don't load fnmatch, glob, codecs
- remove some functionalities and some docstrings
- match wildcard with regexp simplisticly

#return fnmatch.fnmatch(self.name, pattern)

# poor man's fnmatch
pattern = pattern.replace('.', '\\.').replace('*','.*').replace('?','.')
return re.match(pattern, self.name)

But most of it works nicely. Please report bugs in comments.
Download it here path.py.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}