Learn the Python standard library

One of the big benefits of making code available publicly is the feedback received. Sometimes, the feedback points to python standard library modules I was unaware of.

A case in point is a post on Linux Questions in which the author is pointing out the fileinput module.

Python indeed comes with the batteries included 🙂

I will have a more thorough look at the fileinput module and probably refactor the scriptutil.freplace() function (described here) to make use of it.


2 thoughts on “Learn the Python standard library

  1. Muharem,

    Nice work with the scriptutil module — I find it very useful. One feature I’d like to see is the ability to retrieve line numbers from ffindgrep() a la “grep -n”.

    I was going to hack this in myself, but if you’re going to refactor with the fileinput module, this might be an easy extension with fileinput.filelineno()


  2. Hello Mike,

    thanks for your kind comments. Adding line numbers to ffindgrep() output looks reasonably straightforward. I should probably have something tomorrow. Stay tuned 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s