>> Patient: "Doctor! It hurts when I press here."
>> Doctor: "Well don't press there"
I told the doctor I broke my leg in two places.
He told me to quit going to those places.
--Henny Youngman
rpd
--
http://mail.python.org/mailman/listinfo/python-list
Tim Chase a écrit :
(snip)
> If you were using strip() to get rid of the newlines, you can easily
> enough do that with
>
> text = text[:-1]
Which is a very bad idea IMHO.
> Or, depending on what your needs are, rstrip() may do the trick for you.
... eventually with it's optional param:
t
Fredrik Lundh wrote:
> [EMAIL PROTECTED] wrote:
>
> > The following code to search a file for tabs does not work, at least on
> > Windows XP. Could someone please tell me what's wrong? Thanks.
> >
> > xfile = "file_with_tabs.txt"
> > for text in open(xfile,"r"):
> > text = text.strip()
> >
> The following code to search a file for tabs does not
> work, at least on Windows XP. Could someone please tell
> me what's wrong? Thanks.
>
> xfile = "file_with_tabs.txt"
> for text in open(xfile,"r"):
> text = text.strip()
> if ("\t" in text):
> print text
Well, are the tabs e
[EMAIL PROTECTED] wrote:
> The following code to search a file for tabs does not work, at least on
> Windows XP. Could someone please tell me what's wrong? Thanks.
>
> xfile = "file_with_tabs.txt"
> for text in open(xfile,"r"):
> text = text.strip()
> if ("\t" in text):
> print tex
The following code to search a file for tabs does not work, at least on
Windows XP. Could someone please tell me what's wrong? Thanks.
xfile = "file_with_tabs.txt"
for text in open(xfile,"r"):
text = text.strip()
if ("\t" in text):
print text
--
http://mail.python.org/mailman/lis