Python - Doing absolute imports from a subfolder

前端 未结 3 951
感动是毒
感动是毒 2021-02-20 01:59

Basically I\'m asking the same question as this guy: How to do relative imports in Python?

But no one gave him a correct answer. Given that you are inside a subfolder an

3条回答
  •  礼貌的吻别
    2021-02-20 02:30

    If I'm reading correctly, in Python 2.5 or higher:

    from ..Module_B import Module_B
    

    I thought I was well-versed in Python but I had no idea that was possible in version 2.5.

提交回复
热议问题