How to import python class file from same directory?

前端 未结 2 1646
一生所求
一生所求 2021-02-01 02:41

I have a directory in my Python 3.3 project called /models.

from my main.py I simply do a

from models import *

in my __

2条回答
  •  囚心锁ツ
    2021-02-01 03:27

    Apparently I can do: from .finding import Finding and this works.

    And the answer below reflects this as well so I guess this is reasonably correct.

    I've fixed up my file naming and moved my tests to a different directory and I am running smoothly now. Thanks!

提交回复
热议问题