Title: Small example with Python
Slug: small-example-with-python
Date: 2014-06-21 23:15:00
Author: Kartones
Lang: en
Tags: Development, Tools, Python
Description: Built a small Python tool to check if URLs have changed.

<p>Python is a language that slowly is awakening my curiosity. Widely used, generally appraised and apparently powerful and yet easy to use.</p>
<p>After poking with it at work last friday to convert some JSON data to GeoJSON I decided to build a small tool only with Python (2.7): A script that, given a list of URLs, tells me if any of them has changed since last time it ran.</p>
<p>The source code of the results <del>can be found at my Github</del> is no longer available as was a terrible Python 2.x example I no longer maintain. 83 lines of code counting (few) comments. Nothing really cool, in fact it is really simple, but it's a nice exercise as it touches some areas:</p>

<ul> <li>Methods</li> <li>Managing Arrays (Lists in Python) and Hashmaps</li><li>Nulls handling ("None" here)</li> <li>Reading and writing files, detecting if a file exists</li> <li>Exception handling</li> <li>JSON parsing and dumping</li> <li>Basic HTTP requests/responses</li> <li>Colored output *</li></ul> <p> </p> <p>I need to learn more about this language, maybe on the inminent vacations...</p> <p> </p> <p>* Couldn't resist to add some colors, even if meant adding a library (<a href="https://pypi.python.org/pypi/colorama">colorama</a>). And thanks to this I've also learned how to globally install Python libs.</p>