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
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] == ' ':
Hi;
Whenever I call a field from the preceeding form using cgi.FieldStorage() I
get a space on either side. I end up writing code like this to get rid of
that space:
try:
if id[0] == ' ':
id = id[1:len(id)]
except:
pass
try:
if id[len(id) - 1] == ' ':
id = id[0:len(id) - 1]
exce