473,385 Members | 1,901 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,385 software developers and data experts.

How to pass C++ function pointer argument in embedded python environment? 1

1
Hi,All,
background:I have a python api like this,
Expand|Select|Wrap|Line Numbers
  1. def a(arg1,arg2,progress_callback = None)
obviously argument progress_callback is a callback function.In python,I can define a function like this:
Expand|Select|Wrap|Line Numbers
  1. def pro_call(prog_arg1,prog_arg2):
  2.            #do something with arg1 & arg2 
and I just need call a function like follow and it worked
Expand|Select|Wrap|Line Numbers
  1. a(arg1,arg2,progress_callback = pro_call)

question: I don't know how to do like the former exam in embedded python environment.


thank you for your reading ,thanks for any response!
Nov 5 '16 #1
0 1181

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: David Hill | last post by:
Hello - I am using a library that takes a function pointer as an argument. Is the code below not possible? int library_func(void (*func)(int, short, void *)); I am trying to do this... ...
38
by: Radde | last post by:
HI all, Whats the difference b/w pass by ref and pass by pointer in C++ when ur passing objects as args.. Cheers..
6
by: Bernhard | last post by:
Hello, I would like to build a small interpreter (in an c-program), which calls functions with user-defined arguments. To do this, I have a list of functions names (in an array), with the...
17
by: Charles Sullivan | last post by:
The library function 'qsort' is declared thus: void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); If in my code I write: int cmp_fcn(...); int...
2
by: David Rose | last post by:
I have a DLL (not .NET) that takes a function pointer argument and calls that function with an integer argument. The DLL is being called from C#. So far, it is partially working, but the...
7
by: wardm | last post by:
I have created a Dict object in a C++ App that calls (embedded) Python functions. The Dict is to be used to pass variable data between the C++ App and the python functions. However I cannot get...
9
by: cgrebeld | last post by:
Is it possible for a Qt C++ application, which embeds the python interpreter, to import and use PyQt? There can be only one QApplication, which is created in the C++ side, so how would I use that...
9
by: Morten Lemvigh | last post by:
Is it possible to pass a pointer to a constructor or a class definition as argument to a function? Maybe in a way similar to passing function pointers...? The function should construct a number...
7
by: dries | last post by:
Hello lads, I'd like to do the following in C: 1. The user writes a function with predefined arguments and return value in a separate file. 2. The program is compiled as my written 'main'...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.