1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/usr/bin/env python3 import sys ifile = sys.argv[1] ofile = sys.argv[2] templ = '''#pragma once int %s(void) { return 42; } ''' funname = open(ifile).readline().strip() open(ofile, 'w').write(templ % funname)