Created
October 15, 2020 03:19
-
-
Save Everfighting/3c7b167eee3697dfaf94ae6f30f9da09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
将docx,doc文件转换成pdf的后缀,不考虑大小写 | |
""" | |
import re | |
doc_format_list=[r'.docx',r'.doc'] | |
doc_format_pattern='|'.join(doc_format_list) | |
path = r'C:\Users\Administrator\Desktop\temp\托书2 - Copy.DOCX' | |
print(re.sub(doc_format_pattern, r'.pdf', path, flags=re.I)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment