bibi midi dixit:
> Like i thought so, there is no exception to catch if a file already exist.
> I've been browsing the many types of exceptions and cant find anything thats
> close. Thank you for clarifying.
>
Actually, you can. I guess it's not the book author's intent, but you can try
it for
Thanks to all of you that replied. Your inputs are very helpful and
informative.
On Tue, Dec 1, 2009 at 12:14 AM, Sander Sweers wrote:
>
> There is no exception to alert you a file already exists. Depending on
> how you open the file (mode) it will either read, write or append to
> the file. If
"Dave Angel" wrote
My suspicion is that the author just wants you to try to do an open()
(readonly), inside a try/except block, and to successfully handle the
exception.
And the critical thing here is that it must be an open in read mode.
As others pointed out if you use write mode it wi
biboy mendz wrote on 11/30/2009 03:04:52 PM:
>
>
> spir wrote:
> >
> > What is your question?
> > If it's about the type of exception raised when os.path.exists fails,
well, sure it's hard to find:
> >
> > print os.path.exists("foo".bar)
> > ==> False
> >
> >
> My question is: i'm looking
biboy mendz dixit:
>
>
> spir wrote:
> >
> > What is your question?
> > If it's about the type of exception raised when os.path.exists fails, well,
> > sure it's hard to find:
> >
> > print os.path.exists("foo".bar)
> > ==> False
> >
> >
> My question is: i'm looking for type of excepti
2009/11/30 biboy mendz :
> clause, it should be on the fobj-open line. But im still looking for the
> exception that will be raised when i input a filename and that file already
> exists. I hope you get what i mean :-)
There is no exception to alert you a file already exists. Depending on
how you
spir wrote:
biboy mendz dixit:
http://pastebin.ca/1693849
This is end-of-chapter3 exercise of the book Core Python Programming.
I'm reading/searching in the book and other materials but is
unsuccessful. There are at least 50 exceptions listed but I can't find
anything close.
I comment
biboy mendz wrote:
Lie and Tim's input are true that raw_input doesnt do anything or you
cant catch exception error from it. And i'm wrong in placing the
try-except clause, it should be on the fobj-open line. But im still
looking for the exception that will be raised when i input a filename
an
spir wrote:
What is your question?
If it's about the type of exception raised when os.path.exists fails, well,
sure it's hard to find:
print os.path.exists("foo".bar)
==> False
My question is: i'm looking for type of exception that more or less
equivalent to os.path.exists attribute
biboy mendz dixit:
> http://pastebin.ca/1693849
>
> This is end-of-chapter3 exercise of the book Core Python Programming.
>
> I'm reading/searching in the book and other materials but is
> unsuccessful. There are at least 50 exceptions listed but I can't find
> anything close.
>
> I commente
On 12/1/2009 12:00 AM, biboy mendz wrote:
http://pastebin.ca/1693849
This is end-of-chapter3 exercise of the book Core Python Programming.
I'm reading/searching in the book and other materials but is
unsuccessful. There are at least 50 exceptions listed but I can't find
anything close.
I comme
biboy mendz wrote:
http://pastebin.ca/1693849
This is end-of-chapter3 exercise of the book Core Python Programming.
I'm reading/searching in the book and other materials but is
unsuccessful. There are at least 50 exceptions listed but I can't find
anything close.
I commented out my modified
12 matches
Mail list logo