• <small id='awrnn'></small><noframes id='awrnn'>

    <tfoot id='awrnn'></tfoot>
  • <i id='awrnn'><tr id='awrnn'><dt id='awrnn'><q id='awrnn'><span id='awrnn'><b id='awrnn'><form id='awrnn'><ins id='awrnn'></ins><ul id='awrnn'></ul><sub id='awrnn'></sub></form><legend id='awrnn'></legend><bdo id='awrnn'><pre id='awrnn'><center id='awrnn'></center></pre></bdo></b><th id='awrnn'></th></span></q></dt></tr></i><div id='awrnn'><tfoot id='awrnn'></tfoot><dl id='awrnn'><fieldset id='awrnn'></fieldset></dl></div>
      • <bdo id='awrnn'></bdo><ul id='awrnn'></ul>

    1. <legend id='awrnn'><style id='awrnn'><dir id='awrnn'><q id='awrnn'></q></dir></style></legend>

        如何使用 Python (Windows Vista) 检索列表中文件的标签?

        时间:2023-09-03
          <legend id='iJYSI'><style id='iJYSI'><dir id='iJYSI'><q id='iJYSI'></q></dir></style></legend>

              <tbody id='iJYSI'></tbody>

              • <bdo id='iJYSI'></bdo><ul id='iJYSI'></ul>

                  <i id='iJYSI'><tr id='iJYSI'><dt id='iJYSI'><q id='iJYSI'><span id='iJYSI'><b id='iJYSI'><form id='iJYSI'><ins id='iJYSI'></ins><ul id='iJYSI'></ul><sub id='iJYSI'></sub></form><legend id='iJYSI'></legend><bdo id='iJYSI'><pre id='iJYSI'><center id='iJYSI'></center></pre></bdo></b><th id='iJYSI'></th></span></q></dt></tr></i><div id='iJYSI'><tfoot id='iJYSI'></tfoot><dl id='iJYSI'><fieldset id='iJYSI'></fieldset></dl></div>

                  <small id='iJYSI'></small><noframes id='iJYSI'>

                • <tfoot id='iJYSI'></tfoot>
                  本文介绍了如何使用 Python (Windows Vista) 检索列表中文件的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想为我拥有的各种文件夹制作一些标签云,但不幸的是,我似乎找不到在 Windows Vista 中访问文件标签的方法.我尝试查看 win32 模块和 os.stat,但似乎找不到方法.我可以得到一些帮助吗?

                  I want to make something of a tag cloud for various folders I have, but unfortunately, I can't seem to find a way to access the tags of a file in Windows Vista. I tried looking at the win32 module, and os.stat, but I can't seem to find a way. Can I get some help on this?

                  推荐答案

                  我使用了 win32 扩展包,以及我找到的一些演示代码.我在 这个线程.我不想在这里全部复制,但这里是简短的版本(点击前面的链接了解详细信息).

                  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).

                  1. 下载并安装 pywin32 扩展程序.
                  2. 获取 代码 Tim Golden 为就是这个任务.
                  3. 将 Tim 的代码作为模块保存在您自己的计算机上.
                  4. 调用新模块的 property_sets 方法(提供必要的文件路径).该方法返回一个可迭代的生成器对象.请参阅以下示例代码和输出.
                  1. Download and install the pywin32 extension.
                  2. Grab the code Tim Golden wrote for this very task.
                  3. Save Tim's code as a module on your own computer.
                  4. 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.

                  (至少在 XP 中这对我有用.)

                  (This works for me in XP, at least.)

                  例如

                  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
                  

                  这篇关于如何使用 Python (Windows Vista) 检索列表中文件的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:python守护进程中的子进程杀死 下一篇:使用 python 的 lxml 去除内联标签

                  相关文章

                    <bdo id='R3d7o'></bdo><ul id='R3d7o'></ul>
                  <tfoot id='R3d7o'></tfoot>
                • <legend id='R3d7o'><style id='R3d7o'><dir id='R3d7o'><q id='R3d7o'></q></dir></style></legend>

                      <small id='R3d7o'></small><noframes id='R3d7o'>

                      <i id='R3d7o'><tr id='R3d7o'><dt id='R3d7o'><q id='R3d7o'><span id='R3d7o'><b id='R3d7o'><form id='R3d7o'><ins id='R3d7o'></ins><ul id='R3d7o'></ul><sub id='R3d7o'></sub></form><legend id='R3d7o'></legend><bdo id='R3d7o'><pre id='R3d7o'><center id='R3d7o'></center></pre></bdo></b><th id='R3d7o'></th></span></q></dt></tr></i><div id='R3d7o'><tfoot id='R3d7o'></tfoot><dl id='R3d7o'><fieldset id='R3d7o'></fieldset></dl></div>