-----Ursprungligt meddelande----- From: Dave Angel Sent: Tuesday, November 29, 2011 4:25 PM To: Mic Cc: tutor@python.org Subject: Re: [Tutor] How to handle try and except in this case
(You top-posted again. Try to put your remarks AFTER the part you're quoting, so that the message is self-descriptive)
I did? I thought I posted this:
"""
Could you explain what's unclear about it? Andreas couldn't get more specific, since you didn't say how these 10 names are provided.
Yes, it was probably my fault. Sorry about that. I have come up with a new way of working around a problem in my main program so I only need two files to be tested if they exist instead of say 10 files. """
Is that top posting?
The os.path.exists(filename) returns a boolean, and doesn't tie up resources, so you are welcome to use it in an if expression.
if not (os.path.exists(file1) and os.path.exists(file2)):
>print "hi" Thank you! What do you mean with that it "doesn't tie up resources"? Mic _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor