Thomas Aanensen wrote:
Hi all.
I'm sending a class over a socket connection, and I want to use this class
at the new location. The problem is that I get a "module blah does not
exist" error.
Is it possible for me to use this class without importing the module? How?
Any other suggestions?
It sounds like you are using:
import Pickle
socketinstance. send(Pickle.dum ps(classinstanc e))
The above doesn't work. Pickle only encodes the data associated with
that class, not the bytecode required for the functionality. It refers
to the module.class reference to deal with reconstructing it later from
the pickle.
In general, you do need to import the module in order to use the class.
- Josiah