\n\n
在python中分割字符串的最简单方法是什么?
这是我的原始字符串,来自http://ftp2.de.debian.org/debian/dists/stable/main/binary-i386/Packages.gz的 zcat 输出
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
也许你们中的任何人曾经这样做过
理想情况下,这应该是这样的:
{
"zziplib-bin": {"Version": "0.13.56-1+b1"},
"zzuf": {"Version": "0.13.svn20100215-2"},
...
}
- 蒂莫