Jan-06-2019, 10:20 AM
You could perhaps simply remove the echo command and write directly to the nc command stdin
p = subprocess.Popen(["nc", "-U ", Socket1Location], stdin = subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, err = p.communicate(input=b'play')