[Pkg-mpd-commits] [python-mpd] 220/262: add basic usage example
Simon McVittie
smcv at debian.org
Sun May 22 18:16:49 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch upstream
in repository python-mpd.
commit eec7f33ea8ffd2ce1c7a1ca2ea0df0fb05b05e9c
Author: Jörg Thalheim <joerg at higgsboson.tk>
Date: Sun Nov 3 08:37:05 2013 +0100
add basic usage example
---
examples/helloworld.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/examples/helloworld.py b/examples/helloworld.py
new file mode 100644
index 0000000..b713d4d
--- /dev/null
+++ b/examples/helloworld.py
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+import mpd
+
+# use_unicode will enable the utf-8 mode for python2
+# see http://pythonhosted.org/python-mpd2/topics/advanced.html#unicode-handling
+client = mpd.MPDClient(use_unicode=True)
+client.connect("localhost", 6600)
+
+for entry in client.lsinfo("/"):
+ print("%s" % entry)
+for key, value in client.status().items():
+ print("%s: %s" % (key, value))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git
More information about the Pkg-mpd-commits
mailing list