Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6089255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:04:44+00:00 2026-05-23T12:04:44+00:00

From the c-api, I would like to call a python function by name. I

  • 0

From the c-api, I would like to call a python function by name. I would then be calling the function with a list of python objects as arguments.

It is not clear to me in the Python documentation how I would get a “Callable” object from the main python interpreter.

Any help appreciated in:

  1. Getting the address from the function
  2. Calling the function with my PythonObject’s as arguments.

I’m using Python 2.x series for my development.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:04:44+00:00Added an answer on May 23, 2026 at 12:04 pm

    Basically, you use the Python C API to get the module the function is contained in, then query the module dictionary for the function. That’s more or less the same what the Python runtime does internally when your Python code invokes a function from somewhere.

    Relevant functions from the API to look at are PyImport_ImportModule, PyModule_GetDict, PyDict_GetItem and the PyObject_CallXXX family of functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a list from an API call. I would like to be
I have a compiled Python library and API docs that I would like to
I'm making a GUI API (for games, not an OS) and would like to
It seems that licensing terms would prevent us from using Google Maps API in
How would you query Picasa from a Google App Engine app? Data API or
I'm parsing XML results from an API call using PHP and xpath. $dom =
I want to call a Subversion API from a Visual Studio 2003 C++ project.
Is it possible to call a COM API from Java (specifically the HP/Mercury Quality
I am using google app engine and would like to download tweets from a
I have a UIWebView with content populated from a Last.fm API call. This content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.