About 32,000,000 results
Open links in new tab
  1. 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__, …

  2. 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)

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

    Feb 25, 2012 · 269 Many people have already explained about import vs from, so I want to try to explain a bit more under the hood, where the actual difference lies. First of all, let me explain …

  4. 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.

  5. 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 …

  6. 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 …

  7. How to Import python package from another directory?

    The Python interpreter still doesn't know how to reach your instance namespace. In order to do that you can use the PYTHONPATH environment variable, including a path that is parent to …

  8. 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.

  9. How can I do relative imports in Python? - Stack Overflow

    Here is the solution which works for me: I do the relative imports as from ..sub2 import mod2 and then, if I want to run mod1.py then I go to the parent directory of app and run the module using …

  10. python - What happens when using mutual or circular (cyclic) …

    In Python, what happens when two modules attempt to import each other? More generally, what happens if multiple modules attempt to import in a cycle? See also What can I do about …