Python 3 Programming Tutorial – Module Import Syntax




In this tutorial, we cover the various syntax options for importing in Python 3. Depending on your goals, there are many different ways that you can approach importing to make the rest of your programming easier.

Sample code for this basics series:

Python 3 Programming tutorial Playlist:

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6

source

49 thoughts on “Python 3 Programming Tutorial – Module Import Syntax”

  1. this is awesome!!! so you can import parts of a module and rename them for your own purpose…useful!!!

  2. Thanks again. Super useful videos. When it comes to renaming things is there a best practice? For example if working in a team do they frown on you importing "statistics" as "s" . Or are people use to that?

  3. Thanks man! Your performance in teaching and tipping is brilliant. It's unbelievable to get such amount of knowledge from a 5-minute video. Best — Milad

  4. Hey Sentdex, super appreciative of these videos. I just threw myself into Python and I'm thoroughly enjoying it. I have a question which I wonder if you could answer. I've been messing around with creating simple plugins for a video-game. I am no programmer, but this really interests me, and keeps me going with learning how to code. This video-game has all of its modules/library/functions/variables etc. stored in an an assembled C-Sharp.dll. I have been able to sift through it by using a decompiler. However, I'd really like for my IDE to use auto-complete functionality but I am not sure how OR if it is even possible for a Python IDE to interpret an C-Sharp.dll. For example when I type "import math" it gives me a list of possible libraries to import etc. Afterwards when I call a function from the library, like "math.pi" it gives me a list of possible functions/definitions to utilize from the "math." module. This really helps me learn and see what is available and how to properly form the code and get the syntax correct. Would this be possible with a DLL from another programming language, or no? Sorry for the long question and thanks again for your videos!

  5. tanx. i have one doubt in from import statement we import only functions can we import any variable object. here let us consider in statistics module contain object variable " a = 4" can we import "a" object by using from import statement. something like this (from statistics import a ) can we do that is it allowed or it is only for function

  6. Thanks bro ! import statistics as s saved my day lol 😀 I was looking at a complex SDN controller code and was trying to figure out what the heck is going on lol : D

  7. Hello sentdex, first i want to thank you for your very explicit and pedagogic videos.
    I wanted to know how do you do multiline comments? I only know the ''' method but you seem to do it quickly with your method using sharp !

  8. Thank you! just started an internship as a trader assistant and this is saving my life. Can't wait to get to the Quantopian part of your tutorials

  9. I saved the python file in the same location and the file in which I am suppose to import the file is too saved in the same location,still can't import the module which I saved……how would this be solved?Help!

  10. Where are you creating this example file? Im trying to import enums and it says that there is no module named "enum" but I know that "enum.py" exists in python3.x.x/Lib/. Do I need the full path? What if im sharing my code on git and their python3.x.x/Lib is in a different place?

  11. imma java developer and i feel this is just brilliant… i luv python now more java… its like sooo simple… lets see if there is any opinion change after vid 64 and the intermediate series thankyou sentdex for the awesome series… i ve subscribed the day i saw your first vid… sooo informative and to the point… lotsa luv from india… hava nice day

  12. great tutorial, short sweet and simple and you explained everything as you went along while keeping it all straight forward. Thanks helped a lot!

  13. Okay, that may be one of the most useful Python videos I've watched. Just knowing the syntax and how to call different modules in different forms is fantastically useful. Thanks!

Leave a Reply