I wrote a code which needs a .docx file to work. To avoid "docx.opc.exceptions.PackageNotFoundError: Package not found at" error I had to write the path as follows:
from docx import Document
from docx.shared import Pt
from docx.enum.text import WD_ALIGN_PARAGRAPH
document = Document("C:/Users/Murat/Desktop/Combobox/dist/Data.docx/Data.docx")
style = document.styles['Normal']
font = style.font
font.name = 'Times New Roman'
font.size = Pt(12)
But this means that only I can use the program! Or the ones with the same username. I changed the path using "~" but it didn't work:
document = Document("~/Desktop/Combobox/dist/Data.docx/Data.docx")
What do you suggest?