give executable permission to the file: chmod +x docToPDF.py
if using linux, run: 'which python3' and copy the path, then replace on the top of the file, note that must incluse shebang also like #!/usr/bin/python3.
run the script: ./docToPDF.py input.docx output.pdf