I need to execute C++ code to acquire images to process in python.
I need to use these commands from python:
- make and
- ./name_of_the_executable
Could anybody please help know me how to do it?
2 Answers 2
The standard module os provides the system call that allows execution of arbitrary operating system commands from Python. For example:
import os
os.system('ls -latr');
Comments
Look For python.net which is cable of making a call to the interfaces written in .net supported languages. What all you need to do is
Steps:
Download and put it two files
Python.Runtime.dllandclr.pydin your DLLs folder.From you
>>>(triple greater than prompt )Python prompt Try>>>import clrif it doesn't gives any error you are good to go .
Next You need to do is put Your C++ Dll inside Lib/site-packages Folder .
(This is not mandatory but good for beginners).
- Next to
import clrtry importing your Dll as a moduleimport YourDllName
If step 5 doesn't gives you a error . Hola You are done That's All Folks :)
makeutility you wish to run?), in which case they need to be run in another process, see subprocess module in the standard library: docs.python.org/2/library/subprocess.html. How are the images to be passed into python? If you get problems, post what you have tried so far.