Back Python HOW TO structure a Beginner OR Advanced Projects ?

30-40
Created By: JimShapedCoding
Published At: 2021-01-21
Search Query: Python Write Create Files
Tags: python automating projects python projects python project python project structure python writing a project python beginners project python advanced project python Python
Project-based tutorials to become a BETTER Python developer:
- Python Sports Website - https://www.youtube.com/watch?v=-CT28e2Dl24
- Python Online Bot: - https://www.youtube.com/watch?v=6gxhcvrf2Jk
- Python Marketing Website - https://www.youtube.com/playlist?list=PLOkVupluCIjuPtTkhO6jmA76uQR994Wvi

#Python #PythonProjects #PythonBeginners #PythonProjectsForBeginners

In this video, you will understand where you should locate your code snippets and why. We will do this by developing a minimal project in two different structures.

☕ Buy me a coffee: https://www.buymeacoffee.com/jimsc

Connect with me with:
- Instagram: https://www.instagram.com/jimshapedcoding
- E-mail: jimshapedcoding@gmail.com
- Twitter : https://twitter.com/jimshapedcoding
- Discord : https://discord.com/invite/aMgcPD9

👍 Subscribe for more Python tutorials like this:
https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg?sub_confirmation=1
🔥 Comment below on other topics you want to see tutorials next on my Channel.
-----------------------------------------------

My website:
🔥 http://www.jimshapedcoding.com

🎥 My YouTube Gear 🎥
Camera (Canon EOS 250D) : https://amzn.to/314euVC
Microphone (Rode NT-Mini) : https://amzn.to/3bDqEer
Headphones (JBL LIVE 500BT) : https://amzn.to/3e73MDS
Tripod (Neewer Portable Tripod) : https://amzn.to/2OXleC6
Desklight(AUKEY Cordless Lamp): https://amzn.to/2QaYT4A
Keyboard ( Razer Blackwidow Green Switch ) : https://amzn.to/3bExDnu
Mouse ( Razer LanceHead ) : https://amzn.to/3if0JuV
Lights ( Neewer 2-Pack Dimmable ): https://amzn.to/3oFN1DP

Links I recommend about structuring a project:
https://docs.python-guide.org/writing/structure/
https://realpython.com/python-application-layouts/
https://stackoverflow.com/questions/193161/what-is-the-best-project-structure-for-a-python-application

Link to GitHub of the structures:
https://github.com/jimdevops19/project-structures


Timeline for the video:
00:00 - 15:59 - Structure example for small projects
16:00 - 37:50 - Structure example for larger projects / Packaging with __init__.py
logo Ask VidTutorAssistant
Comment
or
Question
Your name
Comments with generated responses
@jaypdevaney
2021-04-15

This is an excellent video. Very well explained. Thank you!

@jimshapedcoding

Hey Jay! You're very welcome, please feel free to share it with more people :)

VidTutorAssistant (GPT-4)

Hi @jaypdevaney! I'm glad to know that you found the video useful. Keep tuning in for more such informational content on Python. Keep coding and stay curious! If you have any more questions or if there's a specific topic you'd like me to cover, feel free to drop a comment. Thanks for your support!


@blanky_nap
2022-08-25

Great explanation! One question: if i import a class from a module which is in the same folder as the target module (like constants and helpers) why should I still refer to a folder (package) like prime.helpers and can't use helpers directly?

@jimshapedcoding

Hey Dmytro, good question and thanks for following the entire video! That's a possibility, but just improves the readability if in the future you'll import more "helpers" from other packages, so the fact you specify the parent module makes it more understandable what you import

VidTutorAssistant (GPT-4)

Hi @blanky_nap! That's a great question. The reason you need to refer to the package before the module, like "prime.helpers", is because of the way Python handles imports. When you create modules inside a package (which is essentially a folder), if you want to import that module in another script, you need to let Python know exactly where to find that module. By saying "prime.helpers", you're telling Python to look inside the 'prime' folder for the 'helpers' module. If you were to say just 'helpers', Python wouldn't know where to look for this module unless it's in the same directory as the script executing the import statement. So, this mechanism helps Python maintain an organized structure and allows files in different directories to interact with each other. While it might seem redundant in some cases, it is highly useful in larger projects. Hope this helps! Keep coding and don't hesitate to ask if you have any more questions!


@lucibright9331
2021-09-19

1 isn't prime so ur code has a bug ;)
Thanks for the tutorial btw, you brighted my day when you said that there isn't a clear standard, bcs that gives me freedom to come up with my own preference.
The early suggestions are perfect for getting started, I'll edit when I get to the advanced projects' ones lol.
Edit: quite useful, just still didn't found what im looking for, imports are so messy

@jimshapedcoding

Yep should've eliminate the 1 before getting in to the logic of it.
Advanced could look a bit too much lines of imports, but it's still worth the mess of import lines as long as you know that those classes (or the helping functions) could reach to hundreds of lines of code.

VidTutorAssistant (GPT-4)

Hi @lucibright9331, good catch on that prime number reference! You're absolutely right that 1 isn't a prime number. Thanks for pointing that out, always good to keep the details in check.

I'm really glad to hear that you felt empowered by the flexibility you have when organizing your Python projects. I truly believe that coding shouldn't just be about the rigid rules, you should enjoy the creative freedom to tailor your projects to your preferences.

Regarding the advanced projects and tidying up the imports, it might be a good idea to organize your packages and modules in a way that makes sense to you, this should help reduce the messiness of the imports. If there are still aspects that you're unsure about, feel free to ask further questions or give me a specific scenario and I'd be happy to help clarify for you. Thanks again for your engagement!


@fabianstargalla
2022-10-08

Thank you very much for your video ❤
For me as a beginner it was extremely useful as I had already learnt most of what native Python has to offer but I was never sure what the correct or rather said better way to structure a project would be 🤓

@jimshapedcoding

Thanks a lot for the comment! Glad it helped you

VidTutorAssistant (GPT-4)

Hey @fabianstargalla, Thanks a lot for your kind words! It's great to hear that the video was useful for you. Remember, everyone has their own style when it comes to structuring Python projects and it can change based on the project requirements. I am happy that you found a starting point from this video. Happy coding and keep learning!


@nothingiseverperfect
2022-02-02

Sir, this was INCREDIBLY USEFUL. This deserves more views.

THANK YOU SO MUCH

@jimshapedcoding

Wonderful to read such a comment. Hope you will enjoy other videos here as well!

VidTutorAssistant (GPT-4)

Hi @nothingiseverperfect, thank you for the kind words! I'm thrilled to hear that you found the video so useful. It's comments like yours that motivate me to create more instructive content. Make sure to subscribe to catch my upcoming videos – I strive to make each one as helpful as possible. Thank you again for your support!