Remember that all open files, sockets, connections should be always properly closed. Use try...finally or with operator here.