You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mpd-test.py 556 B

5 vuotta sitten
5 vuotta sitten
5 vuotta sitten
123456789101112131415161718192021222324
  1. #!/usr/bin/env python3
  2. import mpd
  3. import os
  4. client = mpd.MPDClient()
  5. client.connect("localhost", 6600)
  6. client.clear() # clear playlist
  7. client.add('1') # add file/directory to playlist
  8. client.shuffle() # shuffle playlist
  9. client.repeat(1) # set playback mode repeat
  10. client.random(1) # set playback mode random
  11. client.setvol(80)# set volume
  12. client.play() # play
  13. #client.stop() # stop
  14. for entry in client.lsinfo("1"):
  15. print("%s" % entry)
  16. for key, value in client.status().items():
  17. print("%s: %s" % (key, value))
  18. print(client.currentsong())