1

I am running a python script in order to play two Spotify songs in a row via Echonest api. Apparently, there's something wrong with this osacript syntax:

def play(id1, id2):
    print 'playing', id1, 'then', id2
    os.system("osascript -e 'tell application \"Spotify\" to play tracks \"%s\" and \"%s\"'" % (id1,id2,))

when I print the output to a file:

   sys.stdout.write("playlist\n\n")

I get the proper foreign_id for both tracks:

 `playing spotify:track:172TCtYnKdqRFPGjeGFzgc then spotify:track:5e2PJY0XHGcCLWxZj7UFpR`

what is wrong then?

NOTE: playing only one song works fine.

8-Bit Borges
  • 9,643
  • 29
  • 101
  • 198

0 Answers0