Author Govind
Recipients Govind
Date 2008-10-06.13:01:57
SpamBayes Score 1.256e-10
Marked as misclassified No
Message-id <1223298118.61.0.171396290216.issue4053@psf.upfronthosting.co.za>
In-reply-to
Content
I tried to process a text file (with UTF-8 encoding) which has 
contents like this:


FILE=India
asbds
FILE=Indonasia
ssgsds
FILE=Africa
DBGDGDFG

When I use the below code:
>>> f = open("e:\\temp\\file.txt", 'r')
>>> lines = f.readlines()
>>> for line in lines:
	if line.startswith("FILE="):
		print line.strip("FILE=")


I get output as:
ndia

ndonasia

Africa


I is always stripped if it follows the substring that I want to strip 
off.

Am I doing something wrong here or is this a bug in Python?

-Govind
History
Date User Action Args
2008-10-06 13:01:58Govindsetrecipients: + Govind
2008-10-06 13:01:58Govindsetmessageid: <1223298118.61.0.171396290216.issue4053@psf.upfronthosting.co.za>
2008-10-06 13:01:57Govindlinkissue4053 messages
2008-10-06 13:01:57Govindcreate