I am trying to convert docx file to pdf with following code
import sys
import os
import comtypes.client
wdFormatPDF = 17
in_file = os.path.abspath(sys.arg
Unfortunately COMTypes is designed for Windows, not Linux.
comtypes allows to define, call, and implement custom and dispatch-based COM interfaces in pure Python. It works on Windows, 64-bit Windows, and Windows CE.
Source
You'll need to find another way to do your conversion, likely through another library.