DEV Community

Discussion on: Dead Simple Python: Project Structure and Imports

Collapse
excelite profile image
Benjamin Ewert

thanks a lot for your article, this was exactly what i was looking for since this topic is skipped by basically everyone else...

You said that the topic with the import of app.py instead of using main.py is out of scope... Do you plan on writing up something that is picking this topic up?

I'm quite interested in the reasoning of this approach, do you have any reference by chance?

Collapse
codemouse92 profile image
Jason C. McDonald Author

I don't think there are any formal guidelines on the topic, to be honest. My use of app.py has a lot to do with separation of concerns; I put my GUI startup code in app.py, and my non-GUI startup code in __main__.py. I can't really point to something that says this is "right" or "wrong"...it just works out pretty well for my project. It's something that has to be considered on a project-by-project basis, really.