[Answer]-Control python program with django

1👍

What you are looking for is IPC (inter process communication). My instinct would be to have the music player open a socket, bind to a port, and to listen for commands.

Then in the Django view you open a socket connection to the player, send the command and return a response to the browser.

I you want full two way communication to the browser then you would need to also have a process waiting for output from the music player and sending it back to the browser via a web socket connection. The standard socket tutorial is very handy.

Leave a comment