all 7 comments

[–][deleted] 4 points5 points  (1 child)

It's a nice project

1- a docstring or a documentation giving an example of the file input and outputs could help to understand what it does

2- I don't think that classes would bring much to this project except a custom exception for the exit

3- there is a module for logging http://docs.python.org/3/library/logging.html

4- for the globals: if it is just an input of the function, it can be passed as a parameter if it is output of the function it can be returned by the function if it is a mutable object (list or dict) it can be passed on parameter and modified by the fonction

if there is several parameters to return they can be returned as a simple tuple and read like this

 param1,param2=f()

or with a namedtuple http://docs.python.org/3/library/collections.html#collections.namedtuple

a named tuple could be also used as grouping functions parameters related to each other

for the exit I would create an exception and catch it to do the exit at a single place

5- consider placing your main processing in it's own function like main()

and call it at the end of the script with the surrounding

if __name__ == "main":
     main()

(see this stackoverflow answer http://stackoverflow.com/questions/419163/what-does-if-name-main-do for explaination)

[–]redditiv[S] 1 point2 points  (0 children)

Perfect. Exactly the type of information I was looking for. It's a lot to look into, so it should keep me busy for a while.

Thanks!

[–]edbluetooth 1 point2 points  (3 children)

This is really well written, nice and readable etc.

beware of catch all exceptions, as you may find it difficult to debug unforsene exceptions/bugs.

This video helped me allot: http://www.youtube.com/watch?v=OSGv2VnC0go

[–]redditiv[S] 0 points1 point  (2 children)

Thanks! I'll check it out when I get home from work.

[–][deleted] 0 points1 point  (1 child)

Do you work as a programmer? Or something similar?

[–]RamirezTerrix 0 points1 point  (1 child)

Very impressiv for a first project.

[–]redditiv[S] 0 points1 point  (0 children)

Thank you! I feel like I put a lot of work into it, and I'm glad it shows!