I can write small scripts but have no idea how to structure a full project. Where do I start?

Posted by SpeckiLP@reddit | learnprogramming | View on Reddit | 13 comments

I've been learning Python for a few months. I can solve coding challenges and write scripts that do one thing, like scrape a website or rename files in a folder. But when I try to build something larger, like a small game or a to-do app with a GUI, I freeze up.

I don't know where to put my functions. I don't know how many files I should have or how to make them talk to each other. I end up with one massive script that becomes impossible to debug.

I've looked at open source projects but they feel overwhelming. Everyone talks about design patterns and separation of concerns but I'm still at the stage where I just want my code to not break when I add a new feature.

What's a practical first step for learning project structure? Should I just copy the folder layout from a similar small project and work backwards? Or is there a minimal example somewhere that shows how to organize, say, a 500-line program before adding complexity?