Link to home
Start Free TrialLog in
Avatar of cshore12
cshore12

asked on

Why do I get a string argument error when calling a package class located in another folder?

I have written a Python 2.5.6 (ESRI install) calling routine that is located at ..fc_main\Calls (see attachment 1).  My called package (attachment 2) is located at ..fc_main\Classes.  When I run the calling routine in IDLE version 2.6.5, I get the following error message on the last line:

Traceback (most recent call last):
  File "C:\Projects\Front Counter\fc_main\Calls\TileCall.py", line 8, in <module>
    VisibleCheck.CheckOnOffLayers("Front Counter Data", "Parcels", "False")
TypeError: unbound method CheckOnOffLayers() must be called with VisibleCheck instance as first argument (got str instance instead).

Can you explain why the method is unbound, and why I'm getting this message?

Thanks in advance. TileCall.py MCPIClasses.py
ASKER CERTIFIED SOLUTION
Avatar of ute_arbeit
ute_arbeit
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cshore12
cshore12

ASKER

Both approaches worked like a charm.

I'm also finding that the importing the arcpy module can be very touchy.  I added the appropriate paths to the path and PYTHONPATH system variables, and today the import (obviously) is working OK.  Let's hope it will stick.