2013-04-27, 22:33
I spent most of the afternoon (well the commercial breaks in the IPL, which is pretty much the same thing) trying to work out why my code would not work. After testing all the complicated bits I finally worked out what was wrong.
To do a look up on a wesite I want to capture Artist,Song to add to the end of a url.
I create a variable to capture the tag for artist and one for song and create a third to join them with a comma. But it appears that using is a no-go in python.
So, for example if :
Night = a
Mare = b
then the following happens:
Nightmare = Night + Mare returns ab
Nightmare = Night + "+" + Mare returns a+b
Nightmare = Night + "," + Mare returns a
Other things I've tried:
In one of the incomprehensible discussions on stackflow they said use a join function but trying this doesn't seem to work with variables. I even tried adding the comma to the end of one of the variables (name = xbmc.Player().getMusicInfoTag().getArtist() +","), but again this gives a script error.
I'm at a loss as to what else to try - any suggestions?
To do a look up on a wesite I want to capture Artist,Song to add to the end of a url.
I create a variable to capture the tag for artist and one for song and create a third to join them with a comma. But it appears that using
Code:
variable + "," + variable
So, for example if :
Night = a
Mare = b
then the following happens:
Nightmare = Night + Mare returns ab
Nightmare = Night + "+" + Mare returns a+b
Nightmare = Night + "," + Mare returns a
Other things I've tried:
In one of the incomprehensible discussions on stackflow they said use a join function but trying this doesn't seem to work with variables. I even tried adding the comma to the end of one of the variables (name = xbmc.Player().getMusicInfoTag().getArtist() +","), but again this gives a script error.
I'm at a loss as to what else to try - any suggestions?