]> kaliko git repositories - python-musicpd.git/blobdiff - doc/source/examples/playback.py
Add examples
[python-musicpd.git] / doc / source / examples / playback.py
diff --git a/doc/source/examples/playback.py b/doc/source/examples/playback.py
new file mode 100644 (file)
index 0000000..ce7eb78
--- /dev/null
@@ -0,0 +1,7 @@
+import musicpd
+
+# Using a context manager
+# (use env var if you need to override default host)
+with musicpd.MPDClient() as client:
+    client.play()
+    client.setvol('80')