[Ilugc] c code from glade

  • From: prabhu@xxxxxxxxxxxxxxxxxx (Prabhu Ramachandran)
  • Date: Mon, 8 Jul 2002 22:53:29 +0530

"AV" == avenkatesh79  <avenkatesh79@xxxxxxxx> writes:

    AV> $output = shell_exec("./a.out -l blah -o blah -k blah"); echo
    AV> $output;

    AV> similarly, i want to do from gui interface (either glade or
    AV> python......) ie) able to pass input as arguments to c
    AV> executalbes from gui interface and display the result in the

You could use popen.  Under Python look at the os module and read the
documentation.

import os
os.popen('echo "hi!"').readlines()
['hi!\n']

Any unix machine should also have similar functions available.  You'd
need to include stdio.h and read the man pages.

$ man popen


cheers,
prabhu


Other related posts: