Python vs. Ruby (and os.path.walk)
Matt Gerrans
mgerrans at mindspring.com
Fri Aug 9 14:59:52 EDT 2002
More information about the Python-list mailing list
Fri Aug 9 14:59:52 EDT 2002
- Previous message (by thread): Python vs. Ruby (and os.path.walk)
- Next message (by thread): Python vs. Ruby (and os.path.walk)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Compiling the regular expression inside the walker is probably eating a good number of cycles and doing a lot of repetitive work. Anyway, in this case, you should probably use glob, not re. Also, I have found that you get much nicer code when you create an object for walking the path, and pass its walker method along with self to os.path.walk() -- this is usually done by another method of the class, so using the object is very clean and simple. By the way, you can use the profile module to (profile.run()) to help you find where CPU cycles are going -- it is very easy to use.
- Previous message (by thread): Python vs. Ruby (and os.path.walk)
- Next message (by thread): Python vs. Ruby (and os.path.walk)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list