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

  • SEARCH
  • Home
  • 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 8713389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:20:00+00:00 2026-06-13T05:20:00+00:00

I have a program written in C++ with a web interface to for the

  • 0

I have a program written in C++ with a web interface to for the purpose of RPC. I can call http://localhost/ListVariables or http://localhost/RunFunction?var=1 and have the C code execute ListVariables or RunFunction. It works, but I’d rather not have to manage the web server in C/C++ when there are so many good Python web servers out there.

What I’m imagining is having the C program call into Python to start a web server on another thread (i.e. Tornado), return to C and then continue chugging along doing calculations. Then when the Python server receives a request on http://localhost/ListVariables, it calls back into C and executes ListVariables on the already running process.

C -----> processing -----------> processing ------------> RPC: FuncA -------->
 |                                                        ^        |
  \---> Python Web Server ---------- Request for: FuncA --/   ...   \-------->
                                     ^
  browser: http://localhost/FuncA ---/

The project has the unfortunate caveat that the program must be started from C to begin with. After doing some research this seems to be a bit of a border case, since Python–>C and C–>Python can be done with Cython. However, I can’t find many resources on C–>Python–>C, as most of the examples I’ve found describe linking to libraries and not to already-running processes. Is it possible to have Python call back into a running C program?

  • 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-06-13T05:20:02+00:00Added an answer on June 13, 2026 at 5:20 am

    Absolutely. Create a “fake” module in the C program injected into sys.modules that the Python code can import and access as it would any other module.

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

Sidebar

Related Questions

I have a client program written in .NET 2.0, that connects to the web
I have my program written in C++ and it is can be successfully compiled
I have written a web scraping program to go to a list of pages
Question: I have written a console program that uses the SQL server 2005 web
I have written program in android for downloading from web server I have Used
I have written a program that sends a tcp request to a web address
I have program written in C. It takes 2 arguments username/password and try to
I Have a program written in VB6 that reads a long text file and
I have a program written in C++, on Linux, compiled with -g. When I
I have a program written in VB.Net (Visual Studio 2008) that uses a DLL

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.