DEV Community


Do you have Python tips?

adaendra profile image Maxime Guilbert ・1 min read

Hi everyone,

I'm pretty new in Python devs and I want to know which code structure are you using? Are there some tips to have a clean Python code?

Based on multiple GitHub projects, the one that I used looks like this.

  • controllers
  • models
  • resources
  • routes
  • services
  • static (for webapps exposed by Flask)
  • templates (for webapps exposed by Flask)

Do you have some other tips for Python projects?

Thanks for your help!

Discussion (4)

aminnairi profile image

If you are using (or want to use) the Fish shell, you can use a Fish Function to make your python command run a container with some default options (Python example linked at the end of this article).

Here is how it could look.

$ python -p 8000:8000 -- --host --port 8000
Enter fullscreen mode Exit fullscreen mode

And if you are not using Fish, you will probably have learned one thing or two. Win win.

adaendra profile image
Maxime Guilbert Author

Thanks for the information!

devlorenzo profile image

If you want I have a list of Python IDE / Tools. Do you want me to post it here?

adaendra profile image
Maxime Guilbert Author

Yes, for sure!

Forem Open with the Forem app