Posted on 28th April 2025|43 views
How to import a file from a subdirectory?
I have a file named sample located in my project, I have a subdirectory called lib, including a file called box.py, now I want to import box from sample how can I do this?
Posted on 28th April 2025| views
Try inserting it inside sys.path like this
sys.path.insert(0, './lib')
import Box