On 04/08/2011 11:13 AM, leechau wrote:
Steven wrote:
leechau wrote:
I wrote module1 in package1, and want to use a method named
'method1' in
module1, the caller(test.py) is like this:
import package1
package1.module1.method1()
[...]
When i run test.py, the output is:
AttributeError: 'module
Steven wrote:
leechau wrote:
I wrote module1 in package1, and want to use a method named 'method1' in
module1, the caller(test.py) is like this:
import package1
package1.module1.method1()
[...]
When i run test.py, the output is:
AttributeError: 'module' object has no attribute 'module1'
File
leechau wrote:
> I wrote module1 in package1, and want to use a method named 'method1' in
> module1, the caller(test.py) is like this:
>
> import package1
> package1.module1.method1()
[...]
> When i run test.py, the output is:
> AttributeError: 'module' object has no attribute 'module1'
> File "e:
I wrote module1 in package1, and want to use a method named 'method1' in
module1, the caller(test.py) is like this:
import package1
package1.module1.method1()
module1.py is like this:
def method1():
print 'method1 run!'
The filesystem structure is:
test.py
package1
|__ __init__.py
|__ m