How to Make Your Python Code More Modular and Reusable

  Рет қаралды 17,087

The Code Guy

The Code Guy

Күн бұрын

Пікірлер: 22
@timothynewton5231
@timothynewton5231 5 ай бұрын
Subbed. I wish I had found this 3 years ago when I was first getting started. Hopefully someone newer will stumble across your work and find your work helpful.
@the_code_guy
@the_code_guy 5 ай бұрын
Thanks for the kind words, the support and for watching!
@fiedeldoo
@fiedeldoo Ай бұрын
Great video. I like that you didnt cut out the mistake. This shows that making not everything perfect at the first glance is normal. The inly thing i am missing ist the explanation what the __init__.py is for. You said you would recommend adding an extra file for the function, but why? That would be interesting. Thank you.
@the_code_guy
@the_code_guy Ай бұрын
Glad you like it. The mere presence of __init__.py tells python that the folder is a package. When you import the package any functions in __init__.py will be executed and made avaialble to your code. You may not want to use all thew functionality of a package and so putting them in sub files lets you import just what you need, which is fater. Hope this helps and Thanks for watching!
@Robert256
@Robert256 5 ай бұрын
I am one of these new-to-python viewers. Most of this made sense to me. What environment are you programming in? The one I was introduced to doesn't have the autocomplete feature nor the highlighting of similar arguments, etc...
@the_code_guy
@the_code_guy 5 ай бұрын
I am using pycharm Community in these videos. For me Pycharm is by far the best IDE i've ever used. Thanks for watching!
@Robert256
@Robert256 5 ай бұрын
Thank you, I will check it out!@@the_code_guy
@MuhanadAbulHusn
@MuhanadAbulHusn 3 ай бұрын
The way you explained it is really awesome 👌
@the_code_guy
@the_code_guy 3 ай бұрын
Glad you liked it. Thanks for watching!
@souravbarua3991
@souravbarua3991 Ай бұрын
Very helpful. Thank you for this.
@the_code_guy
@the_code_guy Ай бұрын
Gald it helped. Thanks for watching!
@guocity
@guocity 3 ай бұрын
How to share package with other python files in OS level?
@the_code_guy
@the_code_guy 3 ай бұрын
You would have to install it as a python external packge into python or your venv . There are several ways to do it. Host your own pip server or do a local pip install. Pycharm makes it prety easy if you just want to do it locally. www.jetbrains.com/help/pycharm/creating-and-running-setup-py.html If you want to install in a new venv pip install -e This is a pretty advanced subject. I can add to my future video list if you would like me to cover. Thanks for watching!
@MuhanadAbulHusn
@MuhanadAbulHusn 3 ай бұрын
It would be useful indeed. Personally, I upload my packages to Github and clone it from there
@vvkthegreatest
@vvkthegreatest 4 ай бұрын
Very useful.nthanks
@the_code_guy
@the_code_guy 4 ай бұрын
Glad you found it useful. Thanks for the support!
@somethingdarkinside
@somethingdarkinside 4 ай бұрын
Your voice sounds familiar, hmmm
@the_code_guy
@the_code_guy 4 ай бұрын
I also make content on a certain action RPG or something else?
@somethingdarkinside
@somethingdarkinside 4 ай бұрын
@@the_code_guy that might be it.
@the_code_guy
@the_code_guy 4 ай бұрын
Thanks for coming over. Hope you find it useful!
@dab_u7185
@dab_u7185 18 күн бұрын
42 😂
@the_code_guy
@the_code_guy 16 күн бұрын
It shows up all over the place. For good reason... It is the answer to life, the universe and everythinhg.
Python Classes and Objects made Easy
11:09
The Code Guy
Рет қаралды 2,4 М.
Cleaner Code: 3 Ways You Can Write Cleaner Code
7:41
Coding with Lewis
Рет қаралды 88 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
Worst flight ever
00:55
Adam W
Рет қаралды 23 МЛН
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
How principled coders outperform the competition
11:11
Coderized
Рет қаралды 1,7 МЛН
How To Use FTP In Python
4:01
Taylor's Software
Рет қаралды 988
DuckDB in Python - The Next Pandas Killer?
19:32
NeuralNine
Рет қаралды 30 М.
Why You Shouldn't Nest Your Code
8:30
CodeAesthetic
Рет қаралды 2,7 МЛН
How to Handle Any Error in Python
8:00
The Code Guy
Рет қаралды 4,8 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 275 М.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 273 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 390 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 537 М.