作者kalawang (讨厌虚情假意的人)
看板Python
标题[问题] 有关package使用方式
时间Mon Jan 9 20:02:21 2012
小弟想请问一下关於package使用方式
/
test.py
abc/
__init__.py
a.py
In a.py
def x(x):
print 'a is called'
In test.py
import abc
abc.a.x()
__init__.py is an empty file.
但是在/下执行python test.py却没有成功
File "test.py", line 2, in <module>
abc.a.x()
请问是哪里出错了呢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.218.116
※ 编辑: kalawang 来自: 140.112.218.116 (01/09 20:02)