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 commented out my modified script to just what *should* be applicable.
Can you please point me to the right direction? TIA.

You're trying to take exception from raw_input(); raw_input() merely receive input from the stdin. raw_input() doesn't have anything to do with the file. You should expect the exception to come from the open() function instead.

However, on a little bit of note; open('...', 'w') will (almost) always work since if the file doesn't exists, python will simply create it. The only time it wouldn't work is if you've have file edit permission but not create new file permission.

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to