Python NameError when using an imported function

前端 未结 2 841
悲哀的现实
悲哀的现实 2021-01-29 05:35

When I import and use a function in a python(2.6.5) program, I get an error:

from Localization import MSGR

title = Localization.MSGR(\"Logfile from Ctf2Rrl.\")
         


        
2条回答
  •  遥遥无期
    2021-01-29 05:46

    If you import your method like this, you can user MSGR but not Localization.MSGR :)

    If you want to use Localization.MSGR, you can just import Localization

提交回复
热议问题