I'm trying to copy & paste a company address into a python script to automate my cover letter. when I paste the address it shows up in a single line in the created word document. I want it to be in the number of lines as I copied it.
from docxtpl import DocxTemplate
import datetime
import sys
company_name = input("Enter name of the Company : ")
position_name = input("Enter name of the Position: ")
hiring_person = input("Enter name of the Hiring Person: ")
company_address = input("Enter the company address: ").splitlines()
today_date = datetime.datetime.today().strftime('%m/%d/%Y')
context = {'today_date': today_date,
'company_name' : company_name,
'hiring_person' : hiring_person,
'position_name' : position_name,
'company_address' : company_address}
doc = DocxTemplate("master_cover_letter.docx")
doc.render(context)
doc.save('Cover_letter_'+company_name+'_'+position_name+'.docx')
This is what I had in the "master_cover_letter.docx"
{{today_date}}
{{hiring_person}}
{{company_address}}
Re: Job Application - {{position_name}}
Dear {{hiring_person}},
I am writing to express my interest in the position of {{position_name}}. Having in-depth knowledge in a wide range of relevant technologies and etc.
consider the following as the company address which is in 4 lines.
Tesla Automation GmbH,
Rudolf-Diesel-Strasse 14,
54595 Prüm,
Germany.