TIFF to PDF

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon May 21 07:01:45 EDT 2007


En Mon, 21 May 2007 07:42:21 -0300, revuesbio <revuesbio at gmail.com>  
escribió:

> os.system('"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf
> C:\test.TIF')

\ is used as a escape character in strings.
Use either \\ or a raw string, that is:

os.system('"C:\\Program Files\\GnuWin32\\bin\\tiff2pdf.exe" -o  
C:\\test.pdf C:\\test.TIF')
os.system(r'"C:\Program Files\GnuWin32\bin\tiff2pdf.exe" -o C:\test.pdf  
C:\test.TIF')

(This should be added to the Python FAQ - the most related entry is about  
raw strings ending in \)

-- 
Gabriel Genellina




More information about the Python-list mailing list