Accessing shared library file...

E

Ernesto

I'm in the process of moving a Python application from Windows to
Linux. This means that the drivers for windows ".dll" now must be
Linux drivers "shared library file" (.so I think). With Windows, I
used:

ctypes ("from ctypes import windll")

Then "_dll = windll.NAME"

I'm not sure how to include this new Linux library. Any suggestions?
Thanks!
 
L

Larry Bates

You need to tell us what library file (.dll) are you
accessing on Windows. The interface to whatever the
..dll is used for will most likely be completely
different on Linux.

-Larry Bates
 
E

Ernesto

The .dll file is a shared library file that is associated with a
programming interface for a semi-conductor chip. The chip drivers come
in two different flavors: One is a .dll (for Windows) and the other is
a shared library file for Linux. The name of the Linux file is
"nameofFile.so.0.4.5" The company that makes these drivers (FTDI) says
that the API's for both OS's are practically the same (except you
obviously cannot use WIN32 functions when running on Linux). I wish I
knew more about Linux drivers...
 
P

Peter Hansen

Ernesto said:
The .dll file is a shared library file that is associated with a
programming interface for a semi-conductor chip. The chip drivers come
in two different flavors: One is a .dll (for Windows) and the other is
a shared library file for Linux. The name of the Linux file is
"nameofFile.so.0.4.5" The company that makes these drivers (FTDI) says
that the API's for both OS's are practically the same (except you
obviously cannot use WIN32 functions when running on Linux). I wish I
knew more about Linux drivers...

I believe Larry misinterpreted the question, thinking you were asking
about how to call routines in the library, not just how to load the
library itself. I don't know the answer either, but I can at least
suggest that asking in the ctypes mailing list is pretty much certain to
get you a quick, correct answer (assuming no one gives one here).

-Peter
 
T

Thomas Jollans

Ernesto said:
The .dll file is a shared library file that is associated with a
programming interface for a semi-conductor chip. The chip drivers come
in two different flavors: One is a .dll (for Windows) and the other is
a shared library file for Linux. The name of the Linux file is
"nameofFile.so.0.4.5" The company that makes these drivers (FTDI) says
that the API's for both OS's are practically the same (except you
obviously cannot use WIN32 functions when running on Linux). I wish I
knew more about Linux drivers...

on linux, usually *all* library files are stored in dedicated
directories like /lib /usr/lib or /usr/local/lib you can then acces the
lib just by 'nameofFile'. example: if you have
'/usr/lib/libqt-mt.so.3.3.4' installed, you only need to tell the
compiler to use the library 'qt-mt'. You can create a seperate lib
directory for your project, but you probably need to set some
environment variables for that. I believe pyrex is your friend when
dealing with C libraries in python.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top