os.system is deprecated. Use subprocess instead, which will handle the quoting nicely for you.
Since you have a pipe, you would normally have to create 2 subprocess objects, but here you just want to feed standard input so:
import subprocess p = subprocess.Popen(["/usr/bin/cmd","-parameters"],stdin=subprocess.PIPE) p.communicate('{{"value": {:0.0f}}}\n'.format(value).encode()) # we need to provide bytes rc = p.wait()
The quoting issue is gone, since you're not using a system command to provide the argument, but pure python.
to test this I have changed the command to more so I can run it on windows (which also proves that this is portable):
import subprocess value=12.0 p = subprocess.Popen(["more.com"],stdin=subprocess.PIPE) p.communicate('{{"value": {:0.0f}}}\n'.format(value).encode()) rc = p.wait()
that prints: {"value": 12}
subprocessso the quoting is handled for you