zoukankan      html  css  js  c++  java
  • python小工具收集GUID2class

    # -*- coding: utf-8 -*-
    '''
    Created on 2012-9-16

    @author: IBM
    '''
    from Tkinter import *
    from docutils.nodes import row
    from win32event import *
    from win32api import *
    import win32api

    class EntryFormatting:
    def __init__(self, master):
    frame = Frame(master)
    Label(frame, text=' ').grid(row=0, column=0, sticky=W)
    Label(frame, text=' ').grid(row=0, column=3, sticky=W)

    self._EdtGUID=self.createField(frame, width=26, row=0, col=2,
    label='GUID', format=self.fmtGUID,
    enter=self.activate, change=self.edtChg)
    self._LabelclsName = self.createField(frame, width=26, row=1, label='程序名',
    col=2, enter=self.activate)
    frame.pack(side=TOP, padx=15, pady=15)

    def createField(self, master, label='', text='', width=1, format=None,
    enter=None, row=0, col=0, change=None):
    Label(master, text=label).grid(row=row, column=col-1, padx=15, sticky=W)
    id = Entry(master, text=label, width=width, takefocus=1)
    id.bind('<KeyRelease>', format)
    id.bind('<<Modified>>', change)
    id.bind('<Return>', enter)
    id.grid(row=row, column=col, pady=10, sticky=W)

    def activate(self, event):
    print '<Return>: value is', event.widget.get()

    def fmtGUID(self, event):
    current = event.widget.get()
    from test.test_iterlen import len
    if len(current) != 16:
    self._EdtGUID.text = 'please input right GUID'

    def edtChg(self, event):
    ''''''
    handle = win32api.LoadLibrary('ole32')
    funcProgIdFromClsid = win32api.GetProcAddress(handle, 'ProgIDFromCLSID')
    lpszProgid = ''
    funcProgIdFromClsid(lpszProgid, event.widget.get())
    self._LabelclsName.text = lpszProgid

    if __name__ == '__main__':
    root = Tk()
    root.title('GUID2Class')

    top = EntryFormatting(root)
    quit = Button(root, text="Quit", command=root.destroy)
    quit.pack(side="bottom")

    root.mainloop()
    pass

  • 相关阅读:
    Java类加载器回顾
    2018第24周总结
    JUC类图
    CopyOnWrite 策略
    Python导入模块的几种姿势
    查看linux接口进出口流量的命令;linux 网络监控;流量监控
    jenkins修改日志级别方法
    top命令查看线程信息和jstack使用介绍
    How to force immediate stop of threads in Jmeter servers如何在jmeter执行完,立即停止jmeter
    pycharm支持react
  • 原文地址:https://www.cnblogs.com/maifengqiang/p/2687431.html
Copyright © 2011-2022 走看看