473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

terminology question - "foreign function library"

I am prompted to make these inquiries after seeing the following link
to ctypes:

http://docs.python.org/lib/module-ctypes.html

in which ctypes is described as a foreign function library.

What is the definition of "foreign function library"?
Is the concept different from a "package"?
Is the concept different from a "module"?

Thank you.

Dec 24 '06 #1
2 1604

<mi************@yahoo.comwrote in message
news:11**********************@a3g2000cwd.googlegro ups.com...
|I am prompted to make these inquiries after seeing the following link
| to ctypes:
|
| http://docs.python.org/lib/module-ctypes.html
|
| in which ctypes is described as a foreign function library.
|
| What is the definition of "foreign function library"?

A library for connecting to and making use of foreign functions,
which are functions written in a foreign (to Python) language
and usually not particularly designed with Python in mind.

| Is the concept different from a "package"?
| Is the concept different from a "module"?

Ctypes is one particular module with the particular purpose given.
A module in general can be for any purpose.

Terry Jan Reedy


Dec 24 '06 #2
mi************@yahoo.com wrote:
I am prompted to make these inquiries after seeing the following link
to ctypes:

http://docs.python.org/lib/module-ctypes.html

in which ctypes is described as a foreign function library.

What is the definition of "foreign function library"?
Is the concept different from a "package"?
Is the concept different from a "module"?
Neither. If you have a library, completely unrelated to Python, but you
would like to make calls into it from Python, there are several ways to
proceed.

(A good example of such a library is the OpenGL library:
C:/WINDOWS/SYSTEM32/opengl32.dll.)

You can craft an extension to Python, written in C perhaps and linked to
the DLL in question, that provides functions which can be called from
Python and which make the appropriate calls into the DLL. (Several
products help with building of such an extension module, SWIG being the
one I've used.)

A newer alternative to building such extensions is ctypes. If you can
discern (from the documentation) the exact calling parameters footprint
to a function in a DLL, then ctypes can directly call that function with
your parameters. This is done directly in Python and ctypes without the
need for building any extension module.

Gary Herron
Thank you.

Dec 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Robert Allan Schwartz | last post by:
I've heard the phrase "Miranda function" used to refer to the 6 member functions supplied by the compiler: default constructor copy constructor destructor operator= operator& const operator&
42
by: Martin Jørgensen | last post by:
Hi, I'm trying to move a matlab program into c language. For those who knows matlab, this is the line I want to program in c: hx(1:nx,1:ny) = 0; % nx=10, ny=10 It works on a 2-dimensional...
0
by: H5N1 | last post by:
hi all it's extremely common scenario, so I would like to ask you how do you usually implement CRUD functionality for following structure. Basically it's all about displaying "foreign name" (ie....
3
by: Nicolas Castagne | last post by:
Hi all, I have been wondering for a while why function hiding (in a derived class) exists in C++, e.g. why when writing class Base { void foo( int ) {} }; class Derived: public Base { void...
33
by: Chen shuSheng | last post by:
I have a code: --------------------------- #include <iostream.h> #include <stdlib.h> int main() { int max=15; char line; getline(line,max); system("PAUSE");
28
by: Jess | last post by:
Hello, It is said that if I implement a "swap" member function, then it should never throw any exception. However, if I implement "swap" non- member function, then the restriction doesn't...
2
by: Rahul | last post by:
Hi everyone, I have the following code and it doesn't give any compilation error, class A { public : A() { } void show()
3
by: harryusa | last post by:
My host is running at least PHP 4.3 on a Linux based server and I believe the GD Library is bundled in Php4.3 so I don't know why I am getting this error when trying to use the imagerotate function....
1
by: chrisli | last post by:
Hello, i'm trying to make an Application which can get every Calendar entry from a FOREIGN User in Outlook on a Exchange 2003 Server. At the moment i can only get my own calender entries. But...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.