C, Python

Best way to call a ‘C’ function from Python.

Step 1: Write your 'C' function and save it in a '.c' file. In the below code example, I have written a single 'C' function called 'create_symlink_using_symlinkat'. #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <fcntl.h> #include <errno.h> #include <string.h> int create_symlink_using_symlinkat(char *srcPath, char *targetDir, char *symLinkName) { int dir_fd = open (targetDir, O_RDONLY | O_DIRECTORY);… Continue reading Best way to call a ‘C’ function from Python.