这是我的初始化:
import os, sys
sys.path.append(os.path.abspath(".."))
from myModule import *
然后在命令行中,相同的目录:
Python 2.7.4 (default, Sep 26 2013, 03:20:26)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> c = myClass
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'myClass' is not defined