When I echo a txt document and my service works perfectly, i use the terminal. Here is the command that works: echo $(<piece.txt ) | nc 127.0.0.1 9988
When I try to do the same command in python using os. os.system("echo '$(<piece.txt )' | nc 127.0.0.1 9988")
I have tried all kinds of parenthesis options and different options that wont work.
My preference is to actually echo a string variable. If someone can help me either echo a text doc or echo a string variable it would be much appreciated! Thanks :)
os.system()for that at all? Use the Pythonsocketlibrary and you won't have any need forncin the first place.