I'm using Jetson TK1 board(Linux4Tegra)(almost same with ubuntu)
I followed this instruction(I can't upload clickable link yet...)
Python :
but Python code won't work
this is my error message.
---------------------------------------------------------------------------------------------
"Broken pipe" error message pops up.
how can I solve this problem..?
I followed this instruction(I can't upload clickable link yet...)
Python :
from subprocess import Popen, PIPE p = Popen(['a.out'], shell=True, stdout=PIPE, stdin=PIPE) for ii in range(10): value = str(ii) + '\n' #value = bytes(value, 'UTF-8') # Needed in Python 3. p.stdin.write(value) p.stdin.flush() result = p.stdout.readline().strip() print(result)C++ :
#include <iostream> int main(){ for( int ii=0; ii<10; ++ii ){ int input; std::cin >> input; std::cout << input*2 << std::endl; std::cout.flush(); } }Output from Python :
Output:0
2
4
6
8
10
12
14
16
18
I installed Python properlybut Python code won't work
this is my error message.
---------------------------------------------------------------------------------------------
Error:/bin/sh: 1: a.out: not found
Traceback (most recent call last):
File "CommunicationWithSubprocess3.py", line 7, in <module>
p.stdin.write(value)
IOError: [Errno 32] Broken pipe
------------------------------------------------------------------------------------------------"Broken pipe" error message pops up.
how can I solve this problem..?