from jinja2 import Environment, FileSystemLoader
import subprocess
# jinja2-3.1.2

env = Environment(loader=FileSystemLoader('./script_templates'))
template = env.get_template('template.jinja')

data = {
    'msg': 'hello world!'
}

with open('script.py', 'w', encoding='utf-8') as f:
    f.write(template.render(data))

