#include #include #include #define LOCATION "/Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python" int main(int argc, char* argv[]) { int i; int result; char* command; char* position; int n = strlen(LOCATION) + argc; for (i = 1; i < argc; i++) n += strlen(argv[i]); command = malloc(n*sizeof(char)); if (command==NULL) { printf ("Failed to allocate memory for the Python command\n"); return 0; } position = command + sprintf(command, LOCATION); for (i = 1; i < argc; i++) position += sprintf(position, " %s", argv[i]); result = system(command); free(command); return result; }