You could do
puzzle = __import__('8puzzle')
Very interesting problem. I’ll remember not to name anything with a number.
If you’d like to import *
— you should check out this question and answer.
More Related Contents:
- Does Python IDE have a module which imports math functions such as cos or sin? [closed]
- Relative imports for the billionth time
- Call a function from another file?
- `from … import` vs `import .` [duplicate]
- Importing from builtin library when module with same name exists
- Python: importing a sub‑package or sub‑module
- How to import members of all modules within a package?
- Importing from a relative path in Python
- How to import all submodules?
- Modules are installed using pip on OSX but not found when importing
- Import Error: No module named numpy
- Why do circular imports seemingly work further up in the call stack but then raise an ImportError further down?
- How to access a standard-library module in Python when there is a local module with the same name?
- import text to pandas with multiple delimiters
- How to reload a module’s function in Python?
- ImportError on python 3, worked fine on python 2.7
- numpy.genfromtxt produces array of what looks like tuples, not a 2D array—why?
- Importing classes from different files in a subdirectory
- Python import mechanics
- Python import precedence: packages or modules?
- Python importing a module from a parallel directory
- importing a module in nested packages
- ModuleNotFoundError: No module named ‘…’
- Importing a function from a class in another file? [duplicate]
- import a function from another .ipynb file
- Simple cross import in python
- using variable in import command
- python import module from parent package
- How to reference python package when filename contains a period
- How do I import a Python script from a sibling directory?