Re: linecache and comparison with input
- From: Ross Hetherington <ross@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 15:32:22 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Sebastian Wiesner wrote:
Then you will see, that getline returns the line *including the newline
character*, while raw_input does not. Use line.strip('\n') to remove
trailing newline characters from the return value of getline.
Ah, thank you. I did notice that getline left a trailing newline, but I
didn't realise raw_input didn't. Ooops.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFGhml20HlvQApfM3gRCozzAJ0QAENDkQn8StlEr9Mh0yoCCkUhzQCcCmOC
5tPusqS4MwnisNLZmtKc3Y4=
=hlHr
-----END PGP SIGNATURE-----
.
- References:
- linecache and comparison with input
- From: Ross Hetherington
- Re: linecache and comparison with input
- From: Sebastian Wiesner
- linecache and comparison with input
- Prev by Date: Re: linecache and comparison with input
- Next by Date: Re: shelve crashing under Win ME
- Previous by thread: Re: linecache and comparison with input
- Index(es):