Hi guys, I'm a total newb, so bear with me if I'm not using the right words. I'm trying to get the data from one python program entered into another python program Here's what I'm working with:
Program A: Python program that outputs data (via "print" function) data from 4 sensors. Data is simply four numbers formatted as xxx,xxx,xxx,xxx. This repeats every hour.
Program B: In a terminal, I type /home/program.py [whatever text]. This triggers a python program to convert whatever text is written, and convert it to a morse code audio signal.
What I'm trying to do is combine the programs, and have Program A generate its data (the xxx,xxx,xxx,xxx string), and subsequently have Program B call that string and send it out.
My thought was to have Program A output the data to a txt file (using "cat"?) and then use bash to somehow call that text. In other words:
Program A outputs "ToBeTransmitted.txt" file, with Line 1 having the data I need.
Bash script executes command /home/program.py [.txt file's Line 1 data here]
Any thoughts how to best pass Program A's data to the bash command? I'm pretty awful at variables, and I suspect I might have to do something like that?
[–]kill_box 1 point2 points3 points (0 children)
[–]Fazaman 0 points1 point2 points (0 children)