Intermediate Python Tutorial: How to Use the __init__.py File

preview_player
Показать описание
A succinct tutorial on how to use the __init__.py file to import directories as python libraries.

Welcome to my series for Learning Python, where I will be teaching fundamental concepts in the Python programming language.

These videos will focus on one aspect of Python at a time, but your understanding of the material will be greatly improved through usage. I recommend applying the concepts described here in your own project, or viewing the Developer Diary series where I use these tools on bigger projects.

Рекомендации по теме
Комментарии
Автор

Hello everyone! Another user was having a problem that I want to share with you guys. When you import a package to python, the interpreter searches several paths to find your library - one of which being the working directory. If, however, one of those other paths has a library with the same name, that one will take precedence! If you create a library called Matplotlib, python will still import the original instead of yours!

eom-dev
Автор

I came here to learn __init__, but the way you have demonstrated is absolutely amazing; now I understand what from, import, and __init__.py do. Brilliant!.

ajayjoseph
Автор

Finally a short and to the point tutorial that actually tells me what the frick a __init__.py is and how to use it, thank you!

jackcaesar
Автор

Jeeez I always used init files without typing in anything. 2 years passed here I am finding out this blessing of information. This will clean up a lot of mess in my projects. Huge

mihailbrkoko
Автор

You're a gem! Such a great teacher! If everyone taught like this anyone could learn Python in days!

JV-jcci
Автор

Short and straightforward, great work Eric!

samarjitdebnath
Автор

randomly came across and whatever this is, this helped me understand soo much init and the concept of library, in such a short and engaging video. thank you so much.

cysong
Автор

Thanks for that clear description. This make reusing code so much easier. I have been trying to figure this out for two weeks.

derekknowlton
Автор

Thanks, Eric. This short video was just what I was looking for. I'm a Python newcomer and packages have been difficult to grok until now.

mrc
Автор

Very good explanation. I was wondering why a lot of projects had hundreds of lines of code added to their __init__ file and this has helped a lot. Thanks mate!

poncelas
Автор

Thank you! The first two minutes explained my confusion about why some of my code would work without errors when other code wouldn't. Definitely helped me. Thanks!!!

davidnobles
Автор

concise, short, to the point, just what I was expecting

utpalmohane
Автор

Thanks, no confusing words used. Clearly explained!

swarnimjambhule
Автор

Short and straight to the point. I love this!

Jerry-ucpn
Автор

Thank you so much for this video. I find this topic relatively challenging to understand but now is completely clear for me. Thanks again.

armandoWebDev
Автор

This was the 'dark souls boss' of python for me. You executed him in under 6 minutes. Thank you sensei.

cnsumption
Автор

this might be the best explanation about imports on youtube. thanks man

splendorman
Автор

Thank you very much Eric, I sure appreciate you for this short informative video. Will support you till the end .

alkhashtee
Автор

Short and to the point. Great work Eric 👌
I think I would be coming back to you the next time as well for any help on python.

kya-baat
Автор

Superb succinct tutorial - many thanks!

CyberPsyLen