简体   繁体   中英

working with a library in a different folder python

I have a directory called "code". Within that directory I have to sub directories:

lib: Holds a python module I've created

src: Holds the python source code calling the module.

When I try to run the code, the import statement is not seeing the module in a separate folder. How do I make the two files interact without changing directories?

Trying this, from ../target_directory.library import module . ../ means going up in directory depth.

I hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM