mailcap: use dump-docx.py to dump .docx files
This commit is contained in:
14
bin/dump-docx.py
Executable file
14
bin/dump-docx.py
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
|
||||
# python-docx
|
||||
import docx
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print(f"Usage: {sys.argv[0]} <document> [document ...]")
|
||||
|
||||
for fn in sys.argv[1:]:
|
||||
print(f"\n{fn}:\n")
|
||||
doc = docx.Document(fn)
|
||||
for p in doc.paragraphs:
|
||||
print(p.text)
|
||||
Reference in New Issue
Block a user