Re: File operations

2008-08-22 Thread Fredrik Lundh
John Machin wrote: and don't use the name of the built-in file function as one of your own names "file" is a type, not a function, and has been removed in 3.0. given that "file" is hardly ever used in properly written Python 2 code (if you need to check for file-like behaviour in Python 2, c

Re: File operations

2008-08-21 Thread John Machin
On Aug 22, 9:33 am, Gary Herron <[EMAIL PROTECTED]> wrote: > aditya shukla wrote: > > Hello guys > > > I am trying to search a file say xyz.txt > > > after searching i get the location of the file in > > > search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" > > > now how should i op

Re: File operations

2008-08-21 Thread Gary Herron
aditya shukla wrote: Hello guys I am trying to search a file say xyz.txt after searching i get the location of the file in search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" now how should i open this file i can use file=open("c:\\abc\\xyz.txt","rb") but i have to use search

Re: file operations.

2008-07-25 Thread Fredrik Lundh
aditya shukla wrote: Guys thanks for your previous help .I have a doubt again (I'm sure you mean "a question"; in english, "a doubt" is something slightly different, and quite often more negative.) Also , because of this i am not able to extract the floating point values ie 0.50,0.50,0.66

Re: file operations.

2008-07-24 Thread Terry Reedy
aditya shukla wrote: Guys thanks for your previous help .I have a doubt again My text file is :- 0\9\10\11|0.50|c:\windows\apppatch/AcLayers.dll ... now this is what happens >>> x=open("c:\\test2.txt","rb") >>> x.readline() '\n' ---? i am not able to understand why is new line charac