Never mind. I tried just ignoring the instructions and writing a simple script with no env vars. It works. The fact that you can write this type of script should be documented somewhere. Here it is for any lurkers …
index1 = open("index1.txt", 'r')
html = open("index.html", 'r')
index2 = open("index2.txt", 'r')
indexh = open("include/index.h", 'w')
indexh.write(index1.read())
indexh.write(html.read())
indexh.write(index2.read())
index1.close()
html.close()
index2.close()
indexh.close()