Importing Your Own Python Modules Properly

Importing Your Own Python Modules Properly

NeuralNine

1 год назад

206,030 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Kaushik Singh Rawat
Kaushik Singh Rawat - 25.09.2023 17:49

Was stuck on this for almost two days with most solutions on stack overflow and chatgpt suggesting to use absolute paths, instead of this type of relative pathing to import stuff.
Finally managed to understand it 😆

Ответить
Tejas Nirantar
Tejas Nirantar - 04.09.2023 14:35

thx for this, really helpful

Ответить
rizaldi cakra
rizaldi cakra - 30.08.2023 10:57

It works.
Thank you, really help my project :)

Ответить
The Golden Middle
The Golden Middle - 27.08.2023 21:41

your furnuture... your somwhere from east europe =P

Ответить
bla7091
bla7091 - 15.08.2023 19:30

Good stuff! I did notice that if I package everything into a wheel, without adding the classes to the __init__.py I was getting ModuleNotFound errors whenever I used submodules from the package.

Ответить
Abubakar Naveed Minhas
Abubakar Naveed Minhas - 13.08.2023 12:36

Thanks

Ответить
Person
Person - 31.07.2023 14:53

you saved me a lot of time with this video. thank you. earned my sub

Ответить
Earth Chan
Earth Chan - 28.07.2023 17:52

thank man u saved my so much time

Ответить
Salar Ghaffarian
Salar Ghaffarian - 27.07.2023 21:18

Really informative video. Thanks for recording and sharing it.

Ответить
Austin Moody
Austin Moody - 23.07.2023 01:07

any idea why my vs code isnt importing files from the same directory?

Ответить
javad
javad - 08.07.2023 11:02

very useful

Ответить
RanknwarJit Singh Dhaliwal
RanknwarJit Singh Dhaliwal - 04.07.2023 20:20

what ui is this??? sorry, new to this

Ответить
Anura Senarathna
Anura Senarathna - 02.07.2023 04:54

Very informative. Thank you very much.

Ответить
Tom-JS
Tom-JS - 28.06.2023 12:22

When the teacher says add every number from to 100 instead of doing this 1 +2+3

Of a text editor and type this

total = 0

for num in range(101):
total = num + total
print(total)

It will print the correct answer 5050

Ответить
scottie lin
scottie lin - 24.06.2023 03:05

Very clear explanation Thanks 🎉

Ответить
man frombritain
man frombritain - 21.06.2023 00:12

most of the time i love python but there's something about the way we do this stuff that really does not compute in my head. the file structure of flask apps in general just doesn't work in my head... i find JS frameworks much more simpler to grasp for god's sake

Ответить
ShadyNetwork
ShadyNetwork - 31.05.2023 18:05

Yooo, what is this terminal program and setup, it looks sexy. Thanks for the video!

Ответить
The guy who never came back
The guy who never came back - 12.05.2023 00:43

Does this work if the folders are in git repo?

Ответить
Johi
Johi - 11.05.2023 00:29

Wow, that was actually pretty easy
Thanks you sir

Ответить
Vinayak Pandey
Vinayak Pandey - 09.05.2023 09:03

very nice explanation. understood everything very clearly

Ответить
Anonymous
Anonymous - 04.05.2023 04:26

I am not gonna lie sometimes I get lose in the middle of my code and get confused

Ответить
Amit Tiwari
Amit Tiwari - 27.04.2023 05:49

how use linting in neovim using pylint and how to avoid import error

Ответить
ponambiha Sivan
ponambiha Sivan - 23.04.2023 18:42

amazing!!

Ответить
Dinco422
Dinco422 - 11.04.2023 08:58

As a noob, I've watched this and still have no idea how to add modules, thanks.

Ответить
Razan Ibrahim Omer Mohamed
Razan Ibrahim Omer Mohamed - 31.03.2023 06:12

Thanks bro!

Ответить
Some call me Tim Elderberries
Some call me Tim Elderberries - 30.03.2023 06:41

Nice explanation, best one yet I've seen on modules!

Ответить
Patrik Patrik
Patrik Patrik - 26.03.2023 07:21

Quick and simple explanation thank you !

Ответить
DJaycer
DJaycer - 17.03.2023 02:18

Making a text based rpg, and really needed a way for stats of enemies to be imported properly. I try not to use videos unless I’m A. Learning something or B. Completely lost and have no idea of the full concept of something.

Ответить
Katlego Phele
Katlego Phele - 04.03.2023 17:23

Tutorial on how to setup the environment like yours please

Ответить
Tehreem Akhtar
Tehreem Akhtar - 27.02.2023 19:44

Impressive. To the point content

Ответить
Stephen
Stephen - 13.02.2023 16:57

fyi ~ this did not work for me, yes I had my functions file in the same directory as my blend file, but still I had to add the explicit path as follows, then it worked as shown in video

import bpy
import system
sys.path.append('E:\content\working\latest')
from func import testfunc

Ответить
sirsquirrel0
sirsquirrel0 - 26.01.2023 19:18

Thanks for the video and making the effort. I found it quite difficult to see which files you were editing with the editor. I have rewatched a few times, but its blowing my mind.

Ответить
Saurabh
Saurabh - 26.01.2023 17:34

Thank You Sir. You went into great length to explain this concept.

Ответить
guinea horn
guinea horn - 26.01.2023 07:33

It's really frustrating how bad your videos are and the fact that they're always first when I search for something. Everything is so arbitrary and all over the place. Not to mention that a package is not a module

Ответить
Can Özer
Can Özer - 22.01.2023 14:50

When i try to run my code which is 2 python file inside a folder with all import rules, i am facing _pycache_ and code does not running. I cannot get input some print ext. How can i fix this.

Ответить
Blacktician
Blacktician - 13.01.2023 02:16

To the point, thanks!

Ответить
Paulo Góes
Paulo Góes - 29.12.2022 03:30

Excelent job!
Congrats

Ответить
atcreations
atcreations - 11.12.2022 21:35

According to pyinstaller's official documentation

"
It is not a cross-compiler
- to make a Windows app you run PyInstaller on Windows
- to make a Linux app you run it on Linux, etc
"

Any workaround this?

Ответить
Turgut K.
Turgut K. - 06.12.2022 12:28

can you please put module and code(main) at different folder and access module from code

Ответить
45 Cordic
45 Cordic - 04.12.2022 11:28

what is this test editor name?

Ответить
Heather Gray
Heather Gray - 03.12.2022 21:31

I have always been told that start imports are bad

Ответить
Leonid Grishenkov
Leonid Grishenkov - 03.12.2022 15:18

Thanks a lot!

Ответить
Peter Eziagor
Peter Eziagor - 01.12.2022 08:21

Nice video, I have to learn to use vim like you

Ответить
Dorin Beery
Dorin Beery - 24.11.2022 10:19

thanks a lot, solved many problems.

Ответить
vinod kc
vinod kc - 20.11.2022 15:30

Learned a new thing. "__all__". Thanks a lot.

Ответить
Amir Alizadeh
Amir Alizadeh - 11.11.2022 15:17

what if our module is in another directory? should we amend the system path?

Ответить
not ahmadov
not ahmadov - 10.11.2022 20:06

What is this ide name ? Is it vim ? May you send config ?

Ответить
robbiefryers13
robbiefryers13 - 28.10.2022 11:18

You're confusing the term module with what is actually a package in python. Any file with a py extension is a 'module' in python. A collection of py files in a directory along with an _init_ file is a package, not a module

Ответить
Tanto_id
Tanto_id - 26.10.2022 11:29

Thank you, you explained very clearly

Ответить