How to get a substring with variable indices

Станислав Ягло stas at legche.net
Mon Dec 18 07:37:26 EST 2006


Hello all!

I have a string named text. I need to extract a substring from it 
starting by variable 's' and ending by 'e'.

text[s:e] generates the following error:

    TypeError: slice indices must be integers or None


How to be? :)

Regards, Stanislav Yaglo.



More information about the Python-list mailing list