I went about it with the win32 extensions package, along with some demo code I found. I posted a detailed explanation of the process on this thread. I don't want to reproduce it all here, but here is the short version (click the foregoing link for the details).
- Download and install the pywin32 extension.
- Grab the code Tim Golden wrote for this very task.
- Save Tim's code as a module on your own computer.
- Call the
property_sets
method of your new module (supplying the necessary filepath). The method returns a generator object, which is iterable. See the following example code and output.
(This works for me in XP, at least.)
E.g.
import your_new_module
propgenerator= your_new_module.property_sets('[your file path]')
for name, properties in propgenerator:
print name
for k, v in properties.items ():
print " ", k, "=>", v
The output of the above code will be something like the following:
DocSummaryInformation
PIDDSI_CATEGORY => qux
SummaryInformation
PIDSI_TITLE => foo
PIDSI_COMMENTS => flam
PIDSI_AUTHOR => baz
PIDSI_KEYWORDS => flim
PIDSI_SUBJECT => bar
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…