there is a Python script having the path to the file, you need to open this file in C/C ++ functions, carry out manipulations with it and retu the result in the Python script.
read: but did not understand how to do it.
question@mail.ru
·
01.01.1970 03:00
there is a Python script having the path to the file, you need to open this file in C/C ++ functions, carry out manipulations with it and retu the result in the Python script.
read: but did not understand how to do it.
answer@mail.ru
·
01.01.1970 03:00
Here is a very good example of how to do it github.com/gil9red/simplepyscripts/tree/master/using_custom_ dll
here is an example for UNIX, based on the above
test.py
from CTYPES IMPORT *LIBC = CDLL ( "" "Libmath.so" ") print ( libc .Add ( 1 , 2 )) print ( libc .Sub ( 1 ,, 2 )) math.c
in Add ( int a, int b) { retu a + b; } int su span> ( int a , int b ) { retu a - b; }
assembly to the library (shared libry)
GCC -shared -o libmath.so -fpic math .c Python Test.py Pre>