Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Re: A silly question on file opening
joy99
2/12/2010 8:32:00 PM
On Feb 11, 1:57 am, Anthony Tolle <anthony.to...@gmail.com> wrote:
> On Feb 10, 3:42 pm,joy99<subhakolkata1...@gmail.com> wrote:
>
> > Dear Group,
> > [snip]
> > I tried to change the location to D:\file and as I saw in Python Docs
> > the file reading option is now "r+" so I changed the statement to
> > file_open=open("D:\file","r+")
> > but it is still giving error.
>
> Only use "r+" if you need to also write to the file. "r" is still
> good for opening for reading.
>
> Without seeing a traceback, I can only assume the error is caused by
> using a backslash in the path without escaping it. Try either the
> following:
>
> file_open=open("D:\\file","r+")
>
> file_open=open(r"D:\file","r+")
>
> For an explanation, see the Python documentation:
>
>
http://docs.python.org/reference/lexical_analysis.html#strin...
Dear Group,
I am sorry I could not report. I was trying your solutions, I could
try only one or two, they are working. My problem got solved. Thank
you for your suggestions. But soon I find time, I would try all of
them, so that I can learn more and what I try to do in this room to
get better angles over any problem from experts like you. Thank you
for giving me your valuable time despite your busy schedule.
Wishing you happy day ahead,
Best Regards,
Subhabrata.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: A silly question on file opening
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password