Skip to content

Instantly share code, notes, and snippets.

@standbyme
Created May 25, 2017 06:46
Show Gist options
  • Save standbyme/f122881ced3297a789b8f26fb28bf282 to your computer and use it in GitHub Desktop.
Save standbyme/f122881ced3297a789b8f26fb28bf282 to your computer and use it in GitHub Desktop.
Template
from string import Template
with open("template.md", 'r') as file:
templateFile = file.read()
with open("main.c", 'r') as file:
code = file.read()
template = Template(templateFile)
print(template.safe_substitute(code=code))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment