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

  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. Importing modules in Python - best practice - Stack Overflow

    I am new to Python as I want to expand skills that I learned using R. In R I tend to load a bunch of libraries, sometimes resulting in function name conflicts. What is best practice in Python. I h...

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

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

  6. python - Sibling package imports - Stack Overflow

    I've tried reading through questions about sibling imports and even the package documentation, but I've yet to find an answer. With the following structure: ├── LICENSE.md ├── …

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

  8. Importing from a relative path in Python - Stack Overflow

    Python 2.6 and 3.x supports proper relative imports, where you can avoid doing anything hacky. With this method, you know you are getting a relative import rather than an absolute import.

  9. How do I unload (reload) a Python module? - Stack Overflow

    Jan 13, 2009 · from importlib import reload # Python 3.4+ import foo while True: # Do some things. if is_changed(foo): foo = reload(foo) In Python 2, reload was a builtin. In Python 3, it …

  10. python - How to import from filename that starts with a number

    For what it's worth, from x import * is not a preferred Python pattern, as it bleeds that module's namespace into your current context. In general, try to import things you specifically want from …