I assume that you are asking about the metadata that appears in the Windows Properties dialog box on the Summary tab. (If not, just ignore it.) Here's how I did it.
- Download and install Python win32 extensions . This will put win32, win32com etc. into your Python [ver] / lib / site-packages. They lead win32api, win32com, etc. For some reason, I could not get Python 2.6 (in build 216) to work. I upgraded my system to Python 2.7 and used build 216 for Python 2.7 and it worked. (To download and install, click on the link above, click on the link "pywin32", click on the link for the latest build (currently 216), click on the link for the .exe file that matches your system and Python installation (for me, it was pywin32 -216.win32-py2.7.exe ). Run the .exe file.)
- Copy and paste the code from Get Documentation Summary Information into Tim Gold's. Py tutorial on your own computer.
- Change the code . You really do not need to configure the code, but if you run this Tim script as the main module, and if you do not specify the path as your first sys.argv, you will get an error message. To complete the configuration, scroll down to the end of the code and omit the last block that starts with
if __name__ == '__main__':
Save the file as something like property_reader.py and call its method property_sets(filepath) . This method returns a generator object. You can iterate through the generator to see all the properties and their values. You can implement it as follows:
# Assuming 'property_reader.py' is the name of the module/file in which you saved Tim Golden code... import property_reader propgenerator = property_reader.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 look something like this:
DocSummaryInformation PIDDSI_CATEGORY => qux SummaryInformation PIDSI_TITLE => foo PIDSI_COMMENTS => flam PIDSI_AUTHOR => baz PIDSI_KEYWORDS => flim PIDSI_SUBJECT => bar
Jelliclecat
source share