By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,908 Members | 1,892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,908 IT Pros & Developers. It's quick & easy.

pulling multiple instances of a module into memory

P: n/a
I have a Python app,, that uses a C shared library,
This shared library is an interface that makes connections to another
system (Ham), and among other things uses callback functions.
Therefore, if I want to make multiple connections to Ham, I need to be instantiated in memory multiple times so that everything
works fine.

Right now, in, let's say I want to make two connections to the
Ham system. I call


On the second one, I get a 'duplicate call' error. Because Python is
optimized to only load a module into memory once, I can never make more
than one connection from the same Python script.

Any ideas to work around this would be great.


Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
in, how about something like this:

import eggs

Jul 19 '05 #2

P: n/a
Do you have control over the module? Seems to me the best
answer is to make the start method return a connection object

conn1 = eggs.start('Connection1')
conn2 = eggs.start('Connection2')

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.