Monday, June 1, 2009

wincom snippits

def getImage(self,imageElement):
document = self.mechanize.getDocument()
cr = win32com.client.dynamic.Dispatch(document.body).createControlRange()
cr.add(imageElement)
cr.execCommand("Copy",False,0)
cr.remove(0);
wx.TheClipboard.Open()
do = wx.BitmapDataObject()
wx.TheClipboard.GetData(do)
wx.TheClipboard.Close()
if self.showCaptcha :
self.showCaptcha(do.GetBitmap())

No comments:

Post a Comment