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

Popular posts from this blog

Php operator `break` doesn't stop while -

ubuntu - Bash Script to Check That Files Are Being Created -

vim: Search & replace -