I am using my Raspberry Pi to play songs. I am trying to control the mplayer through a simple python programme. I have chosen python because I new to coding and have set up some simple imput driven menus to choose songs.
I found this code here to play the song :-
import os
SOUND = 'music.mp3'
command = 'mplayer %s 1>/dev/null 2>&1' % SOUND
os.system(command)
But I can't work out how to stop it part way through a track and return to my simple python menu to choose another option. Please help . . .