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