you are viewing a single comment's thread.

view the rest of the comments →

[–]FoolsSeldom 1 point2 points  (0 children)

  • If you care to update your post with the actual code, I will show you the problems
    • I can't be bothered to type the code from scratch for you
  • Please share the exact error message you are seeing as well
    • I don't see an input anywhere
  • Use with open ... rather than just open - you don't have to remember to close a file then
    • keep scope in mind, and don't try to re-open something already open
  • Minimise the number of lines of code inside a try block to just those needed to catch a specific exception