I have a python web server, with a custom text based game and blog. I am struggling separating the code into good places for reference and things are getting out of control.
Things to organize:
Is there any guide or known method that is good follow in working on such projects. I have found that my code starts to become WET (write everything twice) and I can't stop it. I would appreciate any tips from many of you who have much more experience.
If these are the areas that you feel your application makes logical sense to be broken up into, then start creating the modules and moving code around in whichever way makes sense to you.
There's no real right way to do it as it's subjective to each individual use case, but there are static code analysis tools that can be used to help raise the quality level of your code.
Tools that I've used frequently are pep8 (mostly for convention adherence) and pylint. pyflakes is also apparently another great one (I've been meaning to use it). I've found that after running through pep8 and pylint, the number of changes that I've made makes my code much easier to grok (I also learn about some things that I had been doing poorly before) and the result has always been higher quality code overall.
As an aside, I read the comment from @Omnikrys and disagree. Python, being the multi-paradigm language it is, obviously lends itself well to OOP if you choose to go down that path. However, I've found that once you really figure out how to use Python in all of its duck-typing glory and really embrace the "we're all consenting adults" philosophy, you can start writing some very high quality, not over-engineered solutions. Of course, this is highly arguable (I've had quite a few debates on this subject) and completely up to you.