我在控制器中有一個文件名default.py
,並且在同一目錄下有一個文件getmsg.py
,但我不能在default.py
中導入getmsg
。爲什麼不?我將如何導入它?web2py如何在同一目錄下導入模塊?
錯誤:
Traceback (most recent call last):
File "F:\xampp\htdocs\web2py\gluon\restricted.py", line 212, in restricted
exec ccode in environment
File "F:/xampp/htdocs/web2py/applications/tools/controllers/default.py", line 11, in <module>
import getmsg
File "F:\xampp\htdocs\web2py\gluon\custom_import.py", line 81, in custom_importer
raise ImportError, 'Cannot import module %s' % str(e)
ImportError: Cannot import module 'getmsg'
謝謝,這是幫助 – user2149071 2013-03-13 03:14:30