|
- #!/usr/bin/env python3
-
- import mpd
- import os
-
- client = mpd.MPDClient()
- client.connect("localhost", 6600)
-
- client.clear() # clear playlist
- client.add('1') # add file/directory to playlist
- client.shuffle() # shuffle playlist
-
- client.repeat(1) # set playback mode repeat
- client.random(1) # set playback mode random
- client.setvol(80)# set volume
- client.play() # play
- #client.stop() # stop
-
- for entry in client.lsinfo("1"):
- print("%s" % entry)
- for key, value in client.status().items():
- print("%s: %s" % (key, value))
-
- print(client.currentsong())
|