Python not recognising another file -
Python not recognising another file -
i creating python module. test set file in same directory , wrote code
import mymodule mymodule.dofunction
python said >>>no module named mymodule
in same directory.
adapting previous reply here. explicitly state want utilize current directory.
also, consider need "__init__.py" file in each directory importing from.
import os, sys lib_path = os.path.abspath('.') sys.path.append(lib_path) import mymodule
more info on import scheme here.
python
Comments
Post a Comment