• Login or register

discuss.effbot.org

  • Popular
  • Recent
  • 1 point by effbot 1 year ago on Importing Python Modules 1 child

    It doesn't support file paths. It does support package names, but it doesn't really do what you expect: __import__('X.Y.Z') will indeed import the X, X.Y, and X.Y.Z modules and install them in sys.modules, but the function returns the X package module instead of the Z module.

    Also see: http://effbot.org/zone/import-string.htm

    • parent
    • reply
    • 1 point by tepples 1 year ago 0 children

      "The Module Documentation Tells You To Use from-import"

      Examples of this would include everything in __future__.

      • link
      • reply
  • Widget
  • Recent Comments
  • Leaders
Powered by