[ILUG] Python strip "]" from string
glug at lunch.za.net
Tue Oct 7 18:31:30 IST 2008
On Tuesday 07 October 2008 18:56:01 ollie at eillo.org wrote:
> For some reason Python refuses to strip a square bracket from a
> string = "[test]"
> string.strip("[") works fine
> string.strip("]") refuses to work
When it refuses to work, what does it do?
It works for me (TM):
# cat x.py
string = "[test]"
# python x.py
> If i do a test in IDLE it works fine!
You might have some strange UTF-8 in your source file that looks right, but
isn't what you think it is.
More information about the ILUG