0

I have modified a file in usr/bin called tsudpsend.c and made the compilation and gave me no error.

I'm calling this executable file from a python script as follows:

self.proc = []
...appending to self.proc some output from other applications...
self.proc.append(subprocess.Popen(["tsudpsend", "/dev/stdin", out_address, str(port), "10000000", "eth0"], stdin=self.proc[-1].stdout, stdout=subprocess.PIPE))

I understand that if I want to get the output from subprocess.Popen I would use something like this

self.out_pipe = self.proc[-1].stdout.fileno()
print self.out_pipe

However, this is not sufficient. I would like to see the complete logs of this c file running. I've been searching for a while but I have no clue. Any suggestions please?

  • What aren't you seeing? You can get stdout and stdin from the `subprocess.Popen` call and you can redirect them as needed. – AlG Dec 05 '16 at 15:54
  • Do you need something like the `tee` program? – cdarke Dec 05 '16 at 16:04
  • What I wanna see is the output of some print statements inside the executable c file. When I run self.out_pipe = self.proc[-1].stdout.fileno(), self.out_pipe becomes equal to 94 which is not informative for me –  Dec 05 '16 at 16:10
  • Possible duplicate of [read subprocess stdout line by line](https://stackoverflow.com/questions/2804543/read-subprocess-stdout-line-by-line) – Armali Apr 16 '18 at 09:58

0 Answers0