There is a script in the working directory which I can access with:
from . import core.py
I would also like to import * from core.py. How would I write this in Python?
There is a script in the working directory which I can access with:
from . import core.py
I would also like to import * from core.py. How would I write this in Python?
see https://docs.python.org/2/tutorial/modules.html
In section 6.4.2. Intra-package References:
from . import core
from .. import core
from ..other import core
Note: Starting with Python 2.5, in addition to the implicit relative imports, you can write explicit relative imports with the from module import name form of import statement. These explicit relative imports use leading dots to indicate the current and parent packages involved in the relative import. From the surround module.
To keep the exact same semantics as from . import core
, you'll want to do:
from .core import *
I'm pretty sure it's just:
from core import *
Assuming core.py
is in your current working directory or where the script is running from.