Stephen R Laniel a écrit :
On Thu, Jun 21, 2007 at 06:23:01AM -0700, Nick wrote:
Why is there a apostrophe still at the end?
Is it possible that you actually have whitespace at the end
of the line? So then strip() is looking for an apostrophe at
the end of the line, not finding it, and therefore not
stripping it?
that should work for you ?
f1 = open('in.txt', 'r')
for line in f1:
print line.rsplit(':')[4].rstrip().strip("'"),
maybe you got some \n \r at the end of each line
--
http://mail.python.org/mailman/listinfo/python-list