[問題] 有關package使用方式
小弟想請問一下關於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)
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):