<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_template(fn, lang="python"):
 """ Write language-specific script template to file. Arguments: - fn(``string``) path to save the template to - lang('python', 'bash') which programming language """

    with open(fn, "wb") as fh:
        if lang == "python":
            fh.write(PY_TEMPLATE)
        elif lang == "bash":
            fh.write(SH_TEMPLATE)