Python circular importing?

后端 未结 7 1090
不知归路
不知归路 2020-11-22 05:46

So i\'m getting this error

Traceback (most recent call last):
  File \"/Users/alex/dev/runswift/utils/sim2014/simulator.py\", line 3, in 
    f         


        
7条回答
  •  攒了一身酷
    2020-11-22 06:17

    I was able to import the module within the function (only) that would require the objects from this module:

    def my_func():
        import Foo
        foo_instance = Foo()
    

提交回复
热议问题