Category Archive: python

Feb 17

A script to scrape PDFs from a page using Python+Mechanize

A friend asked me for a way to download all the PDFs from a page, and I made this simple script with Python and Mechanize. It's very straightforward... It does hack the user agent, which is not nice. So use at your discretion.


Mar 04

[Python] OpenCV capturing from a v4l2 device

A python snippet on capturing from a v4l2 camera into OpenCV


Mar 02

OpenCV Python YAML persistance

A python snippet for saving OpenCV FileStorage-compatible YAML files


Mar 20

GDoc/LaTeX compilation GUI with Tkinter/Python [w/ code]

Screen Shot 2014-03-20 at 2.47.45 PM

A small GUI to download and compile a PDF from a LaTeX document in Google Docs.


Jun 16

Getting all the links from a MediaWiki format using PyParsing

Hi, Just sharing a snippet of code. Part of a project I'm doing, I need to analyse the links in the Wikipedia corpus. While using the API is one solution, it doesn't retain the order of where links appear in the page. It also returns links that are not part of the main text, which …

Continue reading »


Mar 14

Download all your loved tracks in two simple steps

Screen shot 2011-03-14 at 12.03.26 AM

I'm a fan of online radio, and I have a habit of marking every good song that I hear as a "loved track". Over the years I got quite a list, and so I decided to turn it into my jogging playlist. But for that, I need all the songs downloaded to my computer …

Continue reading »


Jan 25

10 lines-of-code OCR HTTP service with Python, Tesseract and Tornado

Screen shot 2011-01-25 at 12.32.27 PM

Hi I believe that every builder-hacker should have their own little Swiss-army-knife server that just does everything they need, but as a webservice. You can basically do anything as a service nowadays: image/audio/video manipulation, mock-cloud data storage, offload heavy computation, and so on. Tornado, the lightweight Python webserver is perfect for this, and since so …

Continue reading »