my directory structure is:
package_name/ __init__.py script.py time.py i'm trying import time (the built-in package) script.py. however, sibling time.py hooked instead.
what's syntax of importing package globally? (e.g. importing /usr/lib/python2.7/dist-packages)
- in
c#knowglobal::prefix, what's equivalent in python?
be more explicit imports. import time import python time module. from mypackage import time import time module in mypackage package.
import time should never import mypackage.time
that said, don't shadow python built-in names, it's bad habit , leads these headaches later.
Comments
Post a Comment