我的项目里有两个文件-
**file1.py**
class A():
# Some code...
class B():
# Calling an API to get the data
另一个文件是-
**file2.py**
from file1 import A
# Some code....
这里的问题是,我只想导入类A,但由于python的默认行为,它也会编译在类B中编写的代码,这就调用了不必要的API。
如何修复它?
我刚刚在ubuntu10.04.3(遵循自述文件中的所有指令)上安装了python3.2.2,并尝试导入sqlite3模块--结果是:
No module named _sqlite3
然后我查看了lib-dynload目录,其中没有文件_sqlite3.so (但它在python2.6中)。
如何解决这个问题?
谢谢!