module has no attribute

后端 未结 4 880
忘了有多久
忘了有多久 2020-11-30 05:41

I have a directory with a number of .py files in it. each file defines some classes. I also have an empty __init__.py in the directory.

Fo

4条回答
  •  难免孤独
    2020-11-30 06:00

    Modules don't work like that.

    from myproject.mymodule import api
    print api.MyClass
    

提交回复
热议问题