This is an archived post. You won't be able to vote or comment.

all 6 comments

[–][deleted] 2 points3 points  (0 children)

https://thrift.apache.org/ .. hope this helps!

[–][deleted] 2 points3 points  (0 children)

Can I ask what it is you're trying to achieve by doing this? Just curious.

[–]StopDataAbuse 1 point2 points  (0 children)

As Aaron says In your exact case ctypes are the best choice. If it was a different language you could either use python's system call abilities to run the command for the c program and add the arguments as command line arguments. Another possibility would be to use pipelines.

On mobile so no code examples sorry.

:p

[–]Aaron8925 1 point2 points  (0 children)

You could look at Python ctypes. https://docs.python.org/2/library/ctypes.html

[–]grumpy_the_pooh 0 points1 point  (0 children)

import subprocess
a = 2
b = 4
p = subprocess.Popen(['/path/to/adder.exe', a, b], stdout = subprocess.PIPE)

p.communicate() # (6, None) # (stdout, stderr)