Quote:
Originally Posted by kovidgoyal
Code:
def print_version(self,url):
tokens = url.split(',')
tokens[-2:-1] = ['druck-']
return ','.join(tokens)
|
Kovid,
that snippet you gave me replaces the numbers between the last comma and the second last comma with "druck-". But the numbers there should remain and "druck-" should be added in front of the numbers and after the second last comma.
The original link:
Code:
http://www.spiegel.de/panorama/justiz/0,1518,521183,00.html
should be
Code:
http://www.spiegel.de/panorama/justiz/0,1518,druck-521183,00.html
and not (as it will be done with the snippet above):
Code:
http://www.spiegel.de/panorama/justiz/0,1518,druck-,00.html
Thanks for thinking and coding.