0

First of all, I import my libraries:

from docxtpl import DocxTemplate
import pandas as pd
import jinja2

Then, I code this:

doc = DocxTemplate('note-6-template.docx') #open my template

context = {

    'cur_year': 2019,
    'prior_year':2018
}

doc.render(context) #it seems here's is the problem, I'not sure
doc.save('output1.docx')

And my template looks like this:

enter image description here

However, when I tried to render the document I got this message:

expected token 'end of print statement', got 'r'

I'm new at this, so please can you help me?

Maria Fernanda
  • 143
  • 2
  • 8

0 Answers0