Python Programming Tutorial – 38 – Import Modules

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

36 responses to “Python Programming Tutorial – 38 – Import Modules”

  1. Franz Grospe Avatar

    I get this message, <function testmod at 0x033BBAF0>

  2. Ayaz Hussain Avatar

    This method always gives NoneType Object

  3. Joanna Chong Shen Avatar

    Thanks
    Textbook made it so confusing

  4. Abdel6717 Avatar

    how is import module as …?

  5. GPC™ Avatar

    python -m pip install module_name (ex.: python -m pip install matplotlib)
    (don't ask me what the -m is for)

  6. Tom Lynd Avatar

    Is python that easy or Bucky made it look so?

  7. Kolwe Lopi Avatar

    in portable pyscripter I can't import it, I can just call my function. Anybody knows why?
    Thanks for help.

  8. Didi Mutanga Avatar

    Boy you are a G.I could understand the concept in class, but get confused ouside.Your lectures,examples and videos are great.You have clearify alot of stuff.Thank you.Kudos.

  9. Mohammad A El-Musleh Avatar

    thank you . You are good
    can you please tell me which time we put :
    from date import Date

  10. Jimmy Gunawan Avatar

    Can use: reload(swineflu)

  11. benan ton Avatar

    The folders for saving modules for Mac users can be found by writing the following in Idle:

    import sys
    print sys.path

  12. Anthony Walshe Avatar

    Hey, thanks sooo much for this. I nearly had it but by watching this video i know that i need to put e.g what you put:  swineflu.testmod()
    i was just putting e.g swineflu(). 
    Thanks again!! 🙂

  13. Rishi Desai Avatar

    This doesn't work on PyCharm.. . . . .I TRIED TO FIGURE HOW TO IMPORT MODULES YOU MAKE YOURSELF FOR 2 HOURS!!! And it still didn't work. someone please tell me how to import the modules you create yourself, because i created a module with the ".py" and everything on Idle 3.4 and i could import it and access the functions on Idle with "import "module_name" ". But it doesn't work on PyCharm. pls tell me how to make it work

  14. Landon Coats Avatar

    Very very helpful, thank you.

  15. George PritsipidoulasGetTechnical Avatar

    Traceback (most recent call last):
      File "<pyshell#0>", line 1, in <module>
        import circle
    ImportError: No module named circle

    Could you help me? Something is messing up the path?

  16. Irving Limlengco Avatar

    why we need to close the py file? hmm is it the same when we just delete the pyc file for the python to recompile it again? or it is different? thanks 🙂

  17. ripperx444 Avatar

    What if I have 

    baseDirectory/
    _init_.py
        test1/
            _init_.py
            test1.py
        test2/
             __init__.py
             test2.py

    how do you import test1.py into test2.py? They are both on the same level.

  18. Claudia Martins Avatar

    I have two questions:

    1) is "swineflu" a module or an object?
    2) in one of your first tutorials you defined module as a thing with lots of functions (or methods). Im kind of confused about it now.

  19. Yahor Shumski Avatar

    Module's functions behave like object methods in host file. Thank you for this insight!

  20. wong henry Avatar

    thx for this video!!!

  21. Jugglerclown Avatar

    If this helps anyone.. I have a 2.7 version and it didn't work at first. Then I pressed Run Module and it worked just fine 🙂

  22. Harry Pjotr Avatar

    Just do:
     from swineflu import *
    and then you don't have to say the module/save file's name every time you want to refer to something from it.

  23. Sathya Prakash Avatar

    Can u help me with this :

    from sys import argv

     script, first, second, third = argv

     print "The script is called:", script
     print "Your first variable is:", first
     print "Your second variable is:", second
     print "Your third variable is:", third
    can you just say me what is that from and sys and will that argv assigned to all the variables and lot more questions i have i have a basic knowledge of c++ and i am just a beginner please help me . I'm looking forward towards your reply

  24. Sy Xinh Le Avatar

    I use import but I got this:

    import model1
    Traceback (most recent call last):
      File "<pyshell#0>", line 1, in <module>
        import model1
    ImportError: No module named 'model1'

    Please give me a hand, thanks.

  25. Seppänen Juho Avatar

    Thanks to you I'm sure I will pass my exam!

  26. Gunnie Avatar

    "You do not have permission to save to this folder. Contact an administrator blah blah blah."
    ….I AM the administrator.
    Anyone? What's going on here?

  27. Samuel Du Avatar

    Great vid luv the tutorials

  28. hyppiealleena Avatar

    Hey. I'm curious: is there a difference between how you teach in the video to import and using: from (NameOfThePythonSavedFile) import* … ? thanks!

  29. mj31382 Avatar

    hi, for win python 3.3, is there a way to select import modules from folders in custom directories? for example, i made a new folder in C:Python33 and tried calling the module but ImportError came out. i thank you.

  30. Alex Benfield Avatar

    Are you a teacher? COS YOU'RE SO GOOD AT TEACHING!

  31. raguram ram Avatar

    I am getting the following error!! what to do?
    ImportError: No module named div3

  32. jD91mZM2 Avatar

    from swineflu import *

    import all functions in swineflu.
    You don't need swineflu.testmod() only testmod()

  33. puneet sohi Avatar

    Your English is excellent sir!

Leave a Reply

Your email address will not be published. Required fields are marked *