How to call functions in python files that are not in the working directory? -
say working folder .
, supporting python files in ./supporting_files/
, want call function func
in a.py
file under ./supporting_files/
, should do? tried calling from supporting_files.a import func
, not work. how suppose without changing actual working directory?
add __init__.py
file (it can empty) supporting_files
directory, , python treat package available imports. more details available in python documentation.
Comments
Post a Comment