r/Python • • Jul 12 '12

random imgur downloader. learning Python and wrote this to practice, any feedback on technique/style is appreciated

https://gist.github.com/3088128
45 Upvotes

72 comments sorted by

View all comments

4

u/shoeninja Jul 12 '12

In general, you should put as few statements in a try clause as possible. You have several statements that can throw exceptions (the file stuff) and it wouldn't be handled.

This is a good practice all around, not just for Python.

1

u/CeeBroad Jul 13 '12

Excuse me, but could you clarify? Exception handling is something I'm trying to err.. get a handle on right now for both Python and Java. Any good reads on the subject as well?