What is the easiest way to split a string by \n\n in python?
This is my raw string which comes from zcat output of http://ftp2.de.debian.org/debian/dists/stable/main/binary-i386/Packages.gz
Package: zziplib-bin\n
Priority: optional\n
Section: utils\n
Installed-Size: 116\n
Maintainer: LIU Qi <liuqi82@gmail.com>\n
Architecture: i386\n
Source: zziplib (0.13.56-1)\n
Version: 0.13.56-1+b1\n
...\n
\n
Package: zzuf\n
Priority: optional\n
Section: devel\n
Installed-Size: 228\n
Maintainer: Sam Hocevar <sho@debian.org>\n
Architecture: i386\n
Version: 0.13.svn20100215-2\n
...\n
\n
Perhaps any of you have ever done this
This should ideally look like this:
{
"zziplib-bin": {"Version": "0.13.56-1+b1"},
"zzuf": {"Version": "0.13.svn20100215-2"},
...
}
– Timo
I figured it out. Maybe someone can make better suggestions on that.
Output: