summaryrefslogtreecommitdiffstats
path: root/doc/examples/tagfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/tagfile.py')
-rwxr-xr-xdoc/examples/tagfile.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/examples/tagfile.py b/doc/examples/tagfile.py
new file mode 100755
index 0000000..beb749b
--- /dev/null
+++ b/doc/examples/tagfile.py
@@ -0,0 +1,8 @@
+#!/usr/bin/python3
+import apt_pkg
+
+Parse = apt_pkg.TagFile(open("/var/lib/dpkg/status"))
+
+while Parse.step() == 1:
+ print(Parse.section.get("Package"))
+ print(apt_pkg.parse_depends(Parse.section.get("Depends", "")))