I've started a project to create Breakout using pygame.
I'm done with Learn Python the Hard Way and the other basic tutorials and need to know why you make certain things classes, when to create functions, how should the program be designed, how should it flow and so on. Ideally according to best practices.
I feel like I have all the pieces of Python but don't know how to start putting them together to make something that works.
Any advice?
I'd also read some of the best books in general development if you haven't already: http://www.codinghorror.com/blog/2004/02/recommended-reading... Also learn about the SDLC. Applies to every language.
Next, dig deep into the source of a large well-maintained projects such as Django or perhaps pygame. Learn mercurial, and start contributing via bitbucket, github, etc.
Find the right project and you should get valuable feedback for your efforts. ;)
Do you know about "Structure and Interpretation of Coputer Programs" ... IT'S A CLASSIC! http://mitpress.mit.edu/sicp/
(( What kind of maniac downvotes a friendly response? ))
Here's a simple example, and I and some of my compatriots would be willing to pay for someone to build, maintain, and possibly open-source it:
Build a parser that can read logs in the NASDAQ OUCH 4.1 format (http://www.nasdaqtrader.com/content/technicalsupport/specifi...) and generate compliance logs. One example is OATS format (http://www.finra.org/Industry/Compliance/MarketTransparency/...). I currently use a unmaintainable perl regex-happy monstrosity, and would like a clean python version with which I could quickly make changes.
The python workflow should be straightforward and this should not require any esoteric or nonstandard module (but since this is a learning exercise, I won't spoil it)
Here's a warning though. Doing a lot of projects will help but be careful in considering this as a silver bullet. You will probably pick up some bad habits as well as future stuff people will go crazy over.
I would try to do something that involves working with other people. You'll probably have a headache, have an awful time at first but it will teach you a big lesson - how to structure your code in a way that it's more a diplomat that plays nicely with other people's code rather than a war mine that nobody wants to touch with a 1000 foot poll! Once you done that, then choose something in a completely different area (e.g. if you did client-server, try UI desktop application as an example). It doesn't have to be a big project but it will teach you how things can be similar and different.
So in short, solo projects then find your way into a team project of some type.
Just my two cents. Take what's useful and throwaway what you think is bad.
As far as best practices go here is my list:
Automate everything you can.
Keep it coherent.
Rewrite when you find yourself building a house of cards.
When to create a function: anytime something is complicated enough that you think about it abstractly, anytime you use something more than once.
When to create a class: I haven't really nailed down a logical description for how or why I would make a class. Anytime you have a conceptual entity you have a candidate for a class, a player, a socket, a button, a window, a file.
I'm in the same boat. On section 28 of LPTHW. Luckily, I am working with a startup where I hope to cut my teeth helping more with building our product instead of just being a customer guy. I promise to follow up when I get a better answer. Feel free to contact me.
I found projecteuler.net to be a really good source for tough programming/math problems. If you want a never-ending supply of puzzles, that's a good place to go. When I was first learning Python, my classmate & I challenged eachother to see who could do problems 1-50 first. (It took us about a month-- we were also working full time and taking night classes. My classmate finished his 50th a few hours after me.)
Design patterns is a great next step, but it sounds like you're not quite there yet. Something intermediate-level like Dive Into Python will give you more ideas.
I made apps with WxWidgets and Django after learning the basics, but there are a million directions to go in. They just all involve building things and learning as you go.
I know this is rather rude, but doing projects is the only way to learn.
Take it from me, someone who wasted a lot of time trying making it click by study alone.
"How to Design Programs" is a great resource for newcommers and professionals alike. It's a good revision and a good start.
Enjoy.