Re: Goodbying Spaces

2008-04-29 Thread Victor Subervi
On Fri, Apr 25, 2008 at 4:29 PM, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > > Whats the result of using id.strip()?: > > In [1]: " asdfasdf ".strip() > Out[1]: 'asdfasdf' > > It should work, I guess... It didn“t for some reason. That was the first thing I tried. > > > Btw, you can write yo

Re: Goodbying Spaces

2008-04-25 Thread Luis Zarrabeitia
Whats the result of using id.strip()?: In [1]: " asdfasdf ".strip() Out[1]: 'asdfasdf' It should work, I guess... Btw, you can write your code without using len in a cleaner way: try: if id[0] == ' ': id = id[1:] # Note this slice notation... except: pass try: if id[-1] == ' ':