gen.py 249 B

1234567891011121314
  1. #!/usr/bin/env python3
  2. import sys, os
  3. ifile = sys.argv[1]
  4. ofile = sys.argv[2]
  5. with open(ifile, 'r') as f:
  6. resname = f.readline().strip()
  7. templ = 'const char %s[] = "%s";\n'
  8. with open(ofile, 'w') as f:
  9. f.write(templ % (resname, resname))