Simple Python code for Play/Stop Music

I want to make simple Python script to play/stop music of mopidy, can anyone help to write this code?
The script will run on RaspberyPi and stop start music when button clicked… But the part which I am missing is integration with mopidy, not sure what to import and what method to call from python. Any help?

Have a look at the program mpc.

Hey @musicBoxPleaseSleep. I’m venturing down the same path as you (hacking a Rasperry Pi), and for prototyping I hacked a command line client in python: https://github.com/havardgulldahl/mopidycli

The client sends commands via jsonrpclib to control the server.

So if you want to do everything in python, mopidycli will show you how you might do it.

HTH.