Monday, 4 August 2008
Python module for IP-to-country
I'm trying to learn Python at the moment. The language itself is great, but when you're coming from Java, you can't help but thinking that a lot of libraries are missing.
So, today I was playing with how you create modules and how you document things. I made a small module to interface with the IP to country database. While the module is really simple, it was atleast fun to program. The documentation and module can be found here: iptocountry.html. PyDoc is great like JavaDoc, but it takes little time to get used to reading it. Also, one annoying part with PyDoc is that you have to write the doc under the method def and not above it. Kind of separates the code from the declaration, not so ideal if you have big documentation.

