Skip to content

Instantly share code, notes, and snippets.

@monokrome
Created June 20, 2013 18:49
Show Gist options
  • Save monokrome/5825497 to your computer and use it in GitHub Desktop.
Save monokrome/5825497 to your computer and use it in GitHub Desktop.
Templates using built-in Python string formatting.
from .utils import template
x = template('example.sh', '~', options='-al')
ls {options} {0}
def template(name, *args, **kwargs):
return open(name, 'r').format(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment