module import: NameError: name is not defined

后端 未结 3 405
一个人的身影
一个人的身影 2021-01-23 19:08

How do I define the function in the importer so that it is visible inside imported? I tried this

importer.py is

def build():
    print \"bui         


        
3条回答
  •  一个人的身影
    2021-01-23 19:38

    I know that this is a blasphemy but the thing that allows to import a module without tying the imported with importer is easily available in Python as a script language. You can always evaluate a file with execfile

提交回复
热议问题