Please help me! Thanks a lot!
The code of testLib.py:
strTest = 'str test'
world = object
def test():
world.note("test lib func OK..")
The code of testscript.py:
import sys, os
import testLib
world.note("test python lib start..")
world.note(testLib.strTest)
testLib.test()
world.note("test python lib OK..")
world.note(str(os.getcwd()))
I put in the folder:
D:\mud\mushclient506\scripts\testscript.py
D:\mud\mushclient506\testLib.py
Then I set script as testscript.py, and got the following error at line testLib.test()
Quote:
Traceback (most recent call last):
File "<Script Block >", line 6, in <module>
testLib.test()
File "D:\mud\mushclient506\testLib.py", line 6, in test
world.note("test lib func OK..")
AttributeError: type object 'object' has no attribute 'note'
And if I put both file in script folder, the module lib cannot be found
D:\mud\mushclient506\scripts\testscript.py
D:\mud\mushclient506\scripts\testLib.py
Quote:
Traceback (most recent call last):
File "<Script Block >", line 2, in <module>
import testLib
ModuleNotFoundError: No module named 'testLib'