Stefaanlippens - stefaanlippens.net - Stefaan Lippens in hypertext

Latest News:

Spidering JavaScript-manipulated HTML with PhantomJS 15 Apr 2013 | 03:52 am

Even if you are in an automated context, not using a typical browser, fetching the data/webpage from an URL is easy. There are command line tools like wget and curl, and every programming library has ...

Git cherry-pick without whitespace 15 Apr 2013 | 01:46 am

A colleague of mine at work has set up his IDE to clean up all trailing whitespace on save. Nothing wrong with that, except that he is the only one, which very often means in practice that his commits...

Get stacktrace/traceback/backtrace in Python catch body 14 Feb 2013 | 04:40 am

So you have some Python code in a try-catch, and you want the typical Python stacktrace (aka traceback, aka backtrace) in a way you can manipulate? Here are some clues: read more

Check iTunes library for inexistent files and broken links with Python and PyObjC 24 Jan 2013 | 04:35 am

Music files come, music files go. And after some time your iTunes library is sprinkled with cases of The song “Jajazazalala” could not be used because the original file could not be found. Would you ...

Unicode Fun in Python 31 Dec 2012 | 03:46 am

Here is some Python powered unicode fun (command line oneliner version): result:

Git: resolve conflict after stash pop in working directory (no staging/index) 20 Nov 2012 | 06:45 pm

In git, when you do git stash pop of unfinished code after upstream merges, you might get a conflict between the stash and the upstream changes you pulled in. You git clone now has "unmerged paths" a...

Python: determine installation prefix 18 Apr 2012 | 10:27 am

Here's a simple bash oneliner to determine the installation prefix (and more) of a python interpreter: python -c 'import sys;print("\n".join("{0:16s}: {1!r}".format(x, getattr(sys, x)) for x in ["exe...

Python trick: asynchronously reading subprocess pipes 9 Mar 2012 | 01:19 pm

As its name suggests, the Python subprocess allows you to spawn a child/sub process and keep an eye on its standard output through a pipe for example. Very handy to glue together external systems/proc...

Duviz: command line tool for disk usage visualization 7 Mar 2012 | 12:00 pm

duviz.py is a simple UNIX command line utility written in Python to visualize disk space usage. See it in action here: . read more

Simple and quick command line argument handling in Python 17 Jan 2012 | 01:08 pm

When creating a command line tool, you quickly are faced with the burden of handling command line arguments (parsing options, arguments, flags, etc). In Python, the optparse module or, its newer vers...

Recently parsed news:

Recent searches: