r/Python • u/Vicyorus • Jan 25 '15
Ways to improve this project
Since 2013, I have been working on a chat bot for Wikia's (horribly designed) chats. However, being a small developer, my user base is pretty small (consisting of just me), so I have no other way to get input from other human beings (or even robots).
I wanted to know if someone out there would take time to study and point out some modifications that could be done to the project. All help is appreciated.
0
Upvotes
1
1
2
u/badsectors Jan 26 '15
Make use of the built in logging module. Using configurable log levels will allow you to stop doing "
if logging_enabled:" since you can put superfluous things at the DEBUG/INFO level and show errors/important stuff at the WARNING or ERROR level. You would get rid of all yourprintstatements and possibly even this.Run a
pep8linter. Your indentation seems to be all over the place and some of the lines get really long.Last but definitely not least, Tests! Some functions have a lot of branches, and writing good tests will help you to figure out how to break that up into more manageable and logical chunks.