Python - Doing absolute imports from a subfolder

前端 未结 3 2402
鱼传尺愫
鱼传尺愫 2021-02-20 01:56

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:33

    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.

提交回复
热议问题