About 11,300,000 results
Open links in new tab
  1. How do I import other Python files? - Stack Overflow

    How do I import files in Python? I want to import: a file (e.g. file.py) a folder a file dynamically at runtime, based on user input one specific part of a file (e.g. a single function)

  2. python - Importing files from different folder - Stack Overflow

    When importing a file, Python only searches the directory that the entry-point script is running from and sys.path which includes locations such as the package installation directory (it's …

  3. python - `from ... import` vs `import .` - Stack Overflow

    Feb 25, 2012 · I'm wondering if there's any difference between the code fragment from urllib import request and the fragment import urllib.request or if they are interchangeable. If they are …

  4. python - What exactly does "import *" import? - Stack Overflow

    Mar 2, 2010 · In Python, what exactly does import * import? Does it import __init__.py found in the containing folder? For example, is it necessary to declare from project.model import __init__, …

  5. Importing modules in Python - best practice - Stack Overflow

    Some recommendations about lazy imports from python speed performance tips. Import Statement Overhead import statements can be executed just about anywhere. It's often useful …

  6. python - Why is "import *" bad? - Stack Overflow

    The only argument is that Python supports "import *" - if the consensus is that it is bad, then the feature should be removed, perhaps in Python 4 when people are expecting pain, anyway.

  7. Importing packages in Python - Stack Overflow

    Without an explicit import statement (either in FooPackage/__init__.py or in the client program), Python doesn't necessarily know what name it should import foo.py as. On a case insensitive …

  8. python - Use 'import module' or 'from module import'? - Stack …

    Oct 28, 2014 · I've tried to find a comprehensive guide on whether it is best to use import module or from module import. I've just started with Python and I'm trying to start off with best …

  9. python - from ... import OR import ... as for modules - Stack …

    Mar 12, 2015 · As for specific difference between import foo.bar as bar vs from foo import bar, this answer covers the execution differences under Python 3.

  10. python - ImportError: cannot import name - Stack Overflow

    In my case, I refactored a single python script into different modules, leaving some old .py and .pyc files around, and stumbled on the "cannot import name" error.