sites-enabled-tempĺater.py 233 B

123456789101112
  1. #!/usr/bin/env python3
  2. from string import Template
  3. d={'domain': 'domain.com', 'IP': '1.2.3.4', 'PORT': 8000}
  4. with open('../templates/testfile') as f:
  5. src = Template(f.read())
  6. result = src.substitute(d)
  7. print(result)