can't import dl module

  • Thread starter Steven D. Arnold
  • Start date
S

Steven D. Arnold

Hi,

I'm on Mac OS X 10.2.6, using Python 2.3final. I would like to use the dl
module to get access to some system calls, in particular kvm_getprocs.
However, when I try to import dl at the Python command-line, it tells me it
couldn't find the module.

It would seem I have to do something special to get dl to build on my
machine. Does anyone know what that would be? Or is there some other
problem that prevents this from working?

Alternatively, does anyone know what else I could do to get at those calls?
Perhaps I could try SWIG, but that seems like a hassle compared to dl.

Thanks,
steve
 
J

Just

"Steven D. Arnold said:
I'm on Mac OS X 10.2.6, using Python 2.3final. I would like to use the dl
module to get access to some system calls, in particular kvm_getprocs.
However, when I try to import dl at the Python command-line, it tells me it
couldn't find the module.

It would seem I have to do something special to get dl to build on my
machine. Does anyone know what that would be? Or is there some other
problem that prevents this from working?

Alternatively, does anyone know what else I could do to get at those calls?
Perhaps I could try SWIG, but that seems like a hassle compared to dl.

I've never heard of the "dl" module, and Python definitely come with
such a module by default. That said, look for ctypes, it sounds like it
does what you want. By the way, if you used the binary Python.framework
installer, you should have an app called "PackageManager" in
/Application/MacPython-2.3. Then use Bob Ippolito's package repository,
it contains ctypes (see http://www.python.org/packman/). That should
save you the trouble of having to build ctypes yourself.

Just
 
J

John J. Lee

Just said:
I've never heard of the "dl" module, and Python definitely come with
such a module by default. That said, look for ctypes, it sounds like it
[...]

It's a unix-only dlopen wrapper, part of Python standard library.


John
 
J

Just

[email protected] (John J. Lee) said:
Just said:
I've never heard of the "dl" module, and Python definitely come with
such a module by default. That said, look for ctypes, it sounds like it
[...]

It's a unix-only dlopen wrapper, part of Python standard library.

Ah, interesting. In that case it could probably be made to work on
MacOSX as well: there's a dlopen emulation for OSX, ctypes uses that if
I recall correctly.

Just
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top