Sep-11-2017, 01:52 PM
Hi all,
this is my first post and I hope that I select the right thread.
The following python code is working and I can call it from my C source code (I followed the example provided here: https://docs.python.org/2/extending/embedding.html):
RndWP is a class which create a generator: the constructor set all parameters (300, 100, ...) while "NextPlease" is the function of the class which extracts the new value.
Now the problem is that I would like to call NextPlease function from my C code and get the new number from the generator. Right now my C code is able to run the "main" function and get the first number. Ho can I get the second number, the third number and so on?
I'm using python 2.7 due to compatibility problem with the generator (that is, I cannot switch to python3).
Any suggestion is more than welcome.
Thanks,
M
this is my first post and I hope that I select the right thread.
The following python code is working and I can call it from my C source code (I followed the example provided here: https://docs.python.org/2/extending/embedding.html):
1 2 3 4 |
def main: rndWP = RndWP( 300 , 100 , 100 , 10 , 100 , 0 ) x = rndWP.NextPlese() return x |
Now the problem is that I would like to call NextPlease function from my C code and get the new number from the generator. Right now my C code is able to run the "main" function and get the first number. Ho can I get the second number, the third number and so on?
I'm using python 2.7 due to compatibility problem with the generator (that is, I cannot switch to python3).
Any suggestion is more than welcome.
Thanks,
M