Blame src/to_c_cmd.py

Packit Service 50c9f2
# place " at begin of each line
Packit Service 50c9f2
# escape existing '\' and '"'
Packit Service 50c9f2
# remove \n at the end of the line (sometimes the last line does not have a \n
Packit Service 50c9f2
#   so we cannot do a replacement with some other text)
Packit Service 50c9f2
# place an escaped \n and " at the end of each line
Packit Service 50c9f2
import sys
Packit Service 50c9f2
for line in sys.stdin:
Packit Service 50c9f2
    sys.stdout.write('"' + line.replace('\\','\\\\').replace('"','\\"').replace('\n','') + '\\n"\n')