How To Create Your Own Modules In Python (Modularization)
ฝัง
- เผยแพร่เมื่อ 17 ต.ค. 2024
- Modularizing your code is a pretty easy tool to help clear out your code a bit, and make it much more readable. In this video I show you how to define a few functions, save them in a separate file, and import that file as a module in a separate code, while still being able to access those functions.
To keep the module in ipynb:
jupyter-noteboo...
Dear Andrew, Your video is a very good guide and you deserve a big thank you. But a word of caution to newbies; whenever you are trying to make these changes either refresh the JN or restart it. Don't forget to save your data first!
I'm so used to you're comedic skits that I was surprised when I found this after googling for help. Awesome video. Thanks!
I have a python script and the folder with a specific module but every time I run it, it can't import the module. Where do I have to put it for it to be able to find it?
hey you just helped me understand how to create my own modules from a function. life is easy with guys like you. new python guy here
Hello. I am a newbie in programming world. I was stuck not being able to create and use modules in Jupyter Notebook. Thanks to you I can jump to other subjects in my studies of Python. Thank you a lot!
Something I heard over and over in my programming for engineers class: "I don't understand why it won't work. It worked the other 50 times I copied and pasted it!"
More than helpful! less than 10 minutes and you made it so clear! thank you so much for sharing
You do not know how I've looked for this, thank you so much!!
broooooooo thank you so much!! Ive been looking for this for hours and you just solved my problem in a few minutes!!
This is amazing, especially where you stated that the file has to be converted to .py format. Thank you!
Thanks for the video. I wonder why folks can't explain things simply using simple basic code that doesn't involve a simple basic beginner program like passing a couple integer values in and out of a module. Instead everyone puts a very complicated and convoluted code designed for advanced programmers to already recognize. Creating a simple module with just a def that adds a & b then passes it back is so much easier to understand.
Is there any way to do the exactly same thing in Mobile, by using " Pydroid " ?
almost spunked when i saw that the goat dotson has programming videos, so eigenvaluable
Cool to see this done in jupyter. I'm a new to python, but have been coding for years, so the concepts are all very familiar. Just learning the python specifics.
Yeah It reminds me of just using structs or classes in C++, but a bit easier in my opinion!
Glorious Andrew,
you are the first programming youtuber I have watched and actually learned something.
You sir, may be why I finish this programming project with pride and honor.
_You_ deserve a medal!
Thank you for existing, now have a glorious day you fine fellow!
Sincerely,
an indebted viewer
(hopefully my subscription and like is enough payment)
Thanks Man, for the past 1 hour I have been trying to figure this out.
Thanks, man. I was looking for this and you explained perfectly and exactly what I was looking for.
This video was so helpful and saved a lot of time. Thanks!
This was the easiest way I've seen of doing this! Thank you
You mentioned possibly Skype tutoring for physics & math in an older video; what do you think the costs would look like?
Thank you for such an awesome explaining video on Modularization of code
for those who using anacoda
1. run anacoda prompt : search bar , type anacoda --> run administrators
2. run : activateenvironment-name
3. run: where python
4. now you know the place that you can paste you r code (.py)
5. go to python location that definte in step 3
6. the go to : lib>site-packages and paste your code ( plot_classifier.py ).Now you can run python with your new library ( Ex: from plot_classifier import *)
I gave you thumbs up in the first 8 seconds : ) for a nice, sincere start
Is there a way to install these python modules globally?
I think that is more reliable creating your module (adding a setup.py file at the same level of the module) rather than put it manually in site-packages.
I'm really enjoying the merch you have shown here.
I was searching for this so much!!!!! Thanksssssss!!!!!
Thank you sir. Can we use more than one file for longer code in a more simple way, like we do in C++ and in latex?
Great Video on Python Module !!! Thank you
hey.....I found it soo useful...thnx for this video...thnx for being there for learners like me...
thanks for the video, but the issue is that if I have a different jupyter file in another directory, it is not going to import the module. It seems like I need to move the module file all the time with new folder
Thank you so much! I'm starting to learning coding with python and I've been trying to figure out how to do exactly this.
Thx for the nice video!
Do you know how to adjust the uploaded python function within the notebook and then be able to access the newly added function?
I encountered issues here not being able add new functions, even if I deleted and reuploaded the .py-file.
This was great! So clear. How about a video that explains the same thing but if you work from PyCharm?
great work brother....keep it up
Are .py files readable in a text editor? In case I forget what functions I put in there or something
I like Atom for a .py IDE when I am not using jupyter, integrates with Github well too.
Bro knows how to explain like brocode my guy he is leggit,youtube aint paying him enough
I noticed that you have a copy of Jackson's Electrodynamics. I'm actually taking E&M 1 this fall and wanted to know if you'd recommend Jackson or read Griffiths all the way?
If you're talking about undergrad, definitely griffiths. Jackson will fill you with the urge to punt a squirrel.
This video is going to break the internet- as the template of getting to the point and a fantastic explanation- even for me, the FNG to coding. Thank you. and Sub'd
jagexcache? Hmm... Lol. Love the content btw. Your daily upload pace is quite impressive!
Andrew, could you please tell me how to upload the module my_math as .ipynb instead of .py and then import it to another .ipynb file.
Excellent teaching dude!
This was a very helpful video. Thank you so much for do it!
I did my first quick overview! Now, I'll start my coding. But, I'll create the module by using text file.
Finally it worked for me , i was searching for this. Thanks a lot :) :)
How did you learn Python? What are some resources which explain by doing example programs
I learned by just trying to finish certain projects. The Clever Programmer is great for very intro-level python!
Get the solo learn app
And here's a good introduction: th-cam.com/video/Z1Yd7upQsXY/w-d-xo.html
Great video mate !! helped me a lot..
Question: There's a Quantum Field Theory course available for my final year. Really want to study it. Will it be impossible?
I’m 12 and started heavily at quantum physics at the age of ten you will be fine
Hi, I am in high school in Australia and I really love physics. Yours videos are very inspiring and insightful. I want to make a research paper in physics in the area of optics. Do you have any experience in optics? If so, could you please suggest me a subject in optics that hasn’t been properly developed yet?
Spontaneous parametric down-conversion is pretty cool
Andrew Dotson Thanks
why is it when i download asking me the file can harm your computer?
would you do more examples please, thank you , you're doing good work
Thanks a lot! It was super helpful !
Or is there a built-in way to ask python what functions are in there? Or a way you can build it in yourself?
~@4:35 CTRL + x is your friend... good vid
Very helpful, thanks!
really,it's a helpful for create own module .Thanks
Thank you so much for explaining this!
yah.. it was really helpful.thanks buddy
Excellent explication
Plz can you send mi the module you have I need to use it to run something here in python program
you are genius
This was great, Thank you!
Thanks. I'm putting together a library to generate pspice netlists
thanks for your help man..
I got this 💖
thanks brother it is helpful video
very cool.
I am getting No module named error.
thank you so much sir
thanks for sharing :)
Try looking into the camera lens and not the lcd display
Thanks a lot !
It was helpful thanks💖
Dotson! Dotson! We've got Dotson, here!
Thanks. Really helpful :)
Please create a project on how to run a machine learning project of github on jupyter notebook
you are God , I blieve in you!:D
Thanks bro 🙏
thanks a ton!!!!
Thanku so much 😊
thanks man,
Anyone getting a "null" is not defined error??
Lol, do you actully use McAFee? Nice video!
thanks mate
thank you that is great
nice video, but the modularization part actually begins at 4:33
Where's today's video update ?
Rendering now!
4:28
4:57 name of the module
dzieki dziala
Watching you write vec1 twice was painful
lose the hat
No?
jagexcache? Hmm... Lol. Love the content btw. Your daily upload pace is quite impressive!
very cool
Thank you boss
thanku soo much sir