self.create_pdf = tk.IntVar()
tk.Checkbutton(self.root, text=’Convert to PDF’, variable=self.create_pdf).pack()
def convert_to_pdf(doc_name):
pdf_name = doc_name.replace(‘.docx’, ‘.pdf’)
convert(doc_name)
print(f”PDF {pdf_name} created successfully.”)
doc_name = f"{outward_number.replace(' ', '_')}_information.docx"
doc.save(doc_name)
print(f"Document {doc_name} created successfully.")
if self.create_pdf.get():
convert_to_pdf(doc_name)
The above code works fine. But when I run it in .exe application. It says none object has no attribute value ‘write’.
New contributor
Sundar Ravikumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.