Re: search file for tabs

2006-05-02 Thread BartlebyScrivener
>> 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

Re: search file for tabs

2006-05-02 Thread Bruno Desthuilliers
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

Re: search file for tabs

2006-05-02 Thread beliavsky
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() > >

Re: search file for tabs

2006-05-02 Thread Tim Chase
> 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

Re: search file for tabs

2006-05-02 Thread Fredrik Lundh
[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

search file for tabs

2006-05-02 Thread beliavsky
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