First, lets mention Git Bash (aka msysgit) : the old version was a PITA to extend with additional packages (e.g. adding common C libs like libxml), and the new one (renamed Git for Windows), is based on MSYS2, but does not include a package manager.
Hence, we were left with …
... and the standard UNIX tool zipinfo
cannot display them !
So here is Python one-liner to extract them, and other useful meta informations:
python -c "import json, sys, zipfile; json.dump([{k: str(getattr(i, k)) for k in zipfile.ZipInfo.__slots__} for i in zipfile.ZipFile(sys.argv[1]).infolist …
Say you are generating a colored diff output with the standard difflib
Python package:
diff = difflib.ndiff(file1_lines, file2_lines)
print('\n'.join(diff))
Now, I'll show you how to write a simple color_diff
function that you can use to color your diff like this:
diff = difflib.ndiff(file1_lines, file2_lines)
diff …
Nylas provides a modern developer
platform for email, contacts, and calendar. Stop fighting old protocols,
and start building great products
Python Pedia is one stop solution for Python Programming Resources. The Resources are categorized according to the Application of Language. It's all about Python.
pyparallel - Experimental multicore fork of Python 3
Il y a quelques jours, un ami m'a demandé de jeter un oeil à un problème qu'il recontrait: alors qu'il analysait des données de donneespubliques.meteofrance.fr dans un IPython notebook, en utilisant la fantastique lib requests, il a été confronté à un bug étrange:
Mon soucis c'est que ma …
Buildout is a Python-based build system for creating, assembling and deploying applications from multiple parts, some of which may be non-Python-based. It lets you create a buildout configuration and reproduce the same software later. -buildout.org I've documented the steps required to create a simple buildout based project. Start by creating a project directory and initialise…
Depuis plusieurs années, je ruminais contre Youtube: chaque fois qu'une vidéo est supprimée d'une playlist (parce que l'utilisateur qui l'avait uploadé l'a supprimé par exemple), son nom n'est même pas conservé, seul un lien mort persiste dans la liste.
Et la seule solution est alors de googler le nom de …
Python 3.5 is coming up soon with async and await built-in keywords. Let's get excited with a couple of simple examples showing off how to use this new syntax.
Depuis mai 2015, Python 3.4 est disponoble sous Cygwin.
Si vous aviez précédement installé Python 3.2, voici comment passer à la version 3.4.
Tout d'abord, je vous recommande l'excellent gestionnaire de package apt-cyg. C'est tout simplement une interface en ligne de commande équivalente au setup-x86.exe
(ou …
The timeit
module is useful for micro benchmarks, but does not allow to measure execution time of large snippets, as it requires the code tested to fit in a string.
Hence, I went looking for a context or decorator-based solution. And I found this bug report commented by Guido van …
crashreporter - Store and send crash reports directly to the devlopers
python-sdk - Facebook Platform Python SDK
Pourquoi, mais pourquoi faut-il 3 lignes en Java pour juste extraire un groupe d'une expression régulière qui "match" ???
Matcher matcher = Pattern.compile("o?k(b|i)s+").matcher("kiss");
matcher.matches();
assert matcher.group(1) == "i";
En Python:
assert re.match("o?k(b|i)s+", "kiss").group(1) == "i …