What does '__init__.py' do in Python?

preview_player
Показать описание


If you've read a fair amount of Python code, then you've probably seen this "__init__.py" file pop up quite a few times. It's especially common in larger Python projects. I'm going to breakdown exactly what this file is, when you should use it, and exactly how it works.

🎞 Video Resources 🎞

⏳ Timestamps ⏳
00:00 | Understanding Modules & Packages
03:21 | Free Newsletter
04:12 | __init__ Usage
06:40 | Relative Imports & Import Errors
10:06 | Multiple Packages

Hashtags
#Python #PythonFunctions #SoftwareDevelopment
Рекомендации по теме
Комментарии
Автор

I'm learning Fast Api and I kept using these __init__.py but I never knew why they were used. Thanks Tim. It was such a great tutorial.

mrfounderr
Автор

The internet gives me access to so much information, it's like having a genius classmate whose brain I can pick for free. Thanks, Tim, you're a lifesaver!

wellz
Автор

I’m excited to see more beginner friendly videos like these for fast api, Django, etc. Great content, Tim!

dorianlopez
Автор

Thank you, great video. Working with packages is such an important and yet slightly overlooked topic!

alexandrekononov
Автор

one of the most clear and concise video

ammarfasih
Автор

As much as i enjoyed the advice videos. These type of videos are way better. Please do more like this

selomamuzu
Автор

You explained everything with clarity and actual meanings, you got 10/10

oqba
Автор

Videos like this are super handy. Can you make a video series on topics like this, please!?

ScottyMcCraigles
Автор

Please upload this type of videos. These are effective rather than the advice videos. That's my feedback idk about others.

ashutoshmishra
Автор

AI tools will create millions of beginner and intermediate coders that can get by. But listening to guys like Tim will actually make you competent at a deeper level that understands the whys the what’s. Which will speed up your progress exponentially.

cusematt
Автор

love your explanations. clear, straight to the point and simple examples.

Donotfollow
Автор

Thanks for this video! Needed this as I never understood the use of __init__.py and how the relative imports worked (recently found out while debugging code at work).

lawbin
Автор

Very much needed, great stuff, thanks!

Avuvos
Автор

I was still using the init file this whole time.😂.... I learned something today. Thank you Tim

patrickmateus-iqbi
Автор

Finally understand __init__.py! Thanks, Tim!

markrich
Автор

Thank you Tim. I'm learning Python right now, and coming from a CommonJS (NodeJS) background, I'm kinda lost as to how the import system in Python works.
This video helped me clarify some things.

karappo_kun
Автор

fantastic, i am a beginner on Python, good explanation. Please continue your training videos.

cloudlover
Автор

Super clean and simple explanation :) thank you

asv
Автор

Great explanation of this, it makes much more sense now.

bsewart
Автор

Pls do a video addressing the Circular import errors in flask

ChideraKennedy-lm
welcome to shbcf.ru