Data exchange between python script and bash script

Anssi Saari as at sci.fi
Wed Apr 5 08:37:23 EDT 2017


venkatachalam.19 at gmail.com writes:

> For example, the data is printed in
> execute_sensor_process.py as follows:
>
> print >>sys.stderr,sens_data
>
> By printing the data onto sys.stderr and assigning a return variable in the bash, I am expecting the data to be assigned.
>
> But this is not happening.

This part I can answer alhtough I'm not sure it helps with your actual
problems. 

Bash manual explicitly states command substition (the $(...) structure)
replaces the command with the standard *output* of the command. So since
your Python program writes to standard error, you get nothing.



More information about the Python-list mailing list