How to write nice Python code