View Single Post
Old 05-25-2010, 01:26 PM   #1986
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by TouchToneTommy View Post
One thing I tried, was " insert(url[:40] + 'v-print/' + url[40:]) "
I really should never give advice on Python, without testing, but I can't resist. The code above doesn't look right to me. "insert" will put something into a list, but you've got two problems. First is your form - you'd need to specify the list you're inserting into like: list.insert(i, x). The first argument is the index of the element before which to insert.

Second, I don't think you can insert into a string in Python - instead, you create a new string.

You might try this:

Code:
url2 = url[:40] + 'v-print/' + url[40:]
return url2
Starson17 is offline