Look here:
action = "";
strcat(action, "Strategy/ghost.py ");
strcat will not make a string longer, it will crash when that happens because you're wrinting randomly into memory and this way overwrite maybe pointers and variables.
It would work when you have an enough long string, like
char action[1000]
Ohterwise better use strf for making a string, this makes your code much shorter, and strcat is anyway an old and outdated C function.