Python accessing modules from package that is distributed over different directories

后端 未结 4 609
说谎
说谎 2021-01-19 17:29

I have a question regarding one single module that is distributed over multiple directories.

Let\'s say I have these two file and directories:

~/lib/         


        
4条回答
  •  自闭症患者
    2021-01-19 18:16

    You can't without an extreme amount of trickery that pulls one package structure into the other. Python requires that all modules in a package be under a single subdirectory. See the os source to learn how it handles os.path.

提交回复
热议问题