2004年09月06日 星期一 14:03
Hollo 0.706: 天!!垃圾代码!!!! 从1.17版本开始的!谢谢关注! 当初好象是想同时声明两个变量的,结果一次全程替换,换成这样了! 当然也可以安然运行!就是看不明白了!……………………so sorry! 在下干的糊涂事儿! 谢谢!只可惜没有 bugtracker 系统,否则您的贡献会载入史册的是也乎!嗬嗬嗬! /******** [2004-09-06]14:00:41 ; 0.706 wrote: 0.706> 0.706,您好! 0.706> 对不起,弄错了,是79行 0.706> ======= 2004-09-06 13:47:45 您在来信中写道:======= >>Zoom.Quiet,您好! >>第76行: >> self.xmlcnt,self.xmlcnt = "","" >> >>请问这是什么用法,有什么作用? >> >> 致 >>礼! >> >> >> 0.706 >> 0.706 at 163.com >> 2004-09-06 >> >>_______________________________________________ >>python-chinese list >>python-chinese at lists.python.cn >>http://python.cn/mailman/listinfo/python-chinese >> 0.706> = = = = = = = = = = = = = = = = = = = = 0.706> 致 0.706> 礼! 0.706> 0.706 0.706> 0.706 at 163.com 0.706> 2004-09-06 ********************************************/ -- Free as in Freedom Zoom.Quiet #=========================================# ]Time is unimportant, only life important![ #=========================================# sender is the Bat!2.12.00
2004年09月06日 星期一 14:06
info,您好!
	请各位帮忙啊,提点思路也好。先谢谢了。
======= 2004-09-06 11:25:05 您在来信中写道:=======
>python-chinese,您好!
>
>处理com调用时,继承出现了问题。下面是代码。也包含了思路和注释,请教各位了,
>刘鑫的意见是,每个com都有个sender可以传递进去,但是我觉得我这里传递进去的self,相当于sender,
>而且奇怪的是,如果在EventHandler继承其他的类,能继承一些方法,但是其他方法却无法继承下来。
>
>其实将tt这个方法写到EventHandler这个类里面,确实能够调用,但是问题是这样写代码就觉得太别扭了
>比如我想当这个事件发生后,用uss项目的客户端来通知服务器端,这个程序打开了什么网页操作就变得不可行了。
>
>请教各位了,这个问题比较急。
>
>
># -*- coding: cp936 -*-
>import win32gui
>import win32com
>import win32com.client
>import pythoncom
>import time
>
>        
>
>class EventHandler:
>        
>    def OnVisible(self, visible):
>        global bVisibleEventFired
>        bVisibleEventFired = 1
>    def OnDownloadBegin(self):
>        print "DownloadBegin"
>        
>    def OnDownloadComplete(self):
>        print "DownloadComplete"
>    def OnDocumentComplete(self, pDisp = pythoncom.Missing , URL = pythoncom.Missing):
>        """当打开完成这个事件发生时,再来调用self.tt这个方法,就不能调用,因为没有继承下来。"""
>        print "documentComplete of %s" % URL
>        print dir(self)
>        self.tt()
>        
>class start(EventHandler):
>    def __init__(self):
>        """调用自己的tt方法,这时候是正常的,可以调用,self里面也有tt这个方法"""
>        print dir(self)
>        self.tt()
>        """这里用EventHandler类来处理发生的事件,我找了很多资料,好象这个是标准写法"""
>        ie = win32com.client.DispatchWithEvents("InternetExplorer.Application", EventHandler)
>        ie.Visible = 1
>        """打开网址,这个地址打不开,不过不影响整个代码的思路和继承,可以换成能打开的地址测试"""
>        ie.Navigate("www.aawns.com")
>        pythoncom.PumpMessages()
>        ie.Quit()
>        
>    def tt(self):
>        print 'test'
>
>
>a=start()
>
>
>        致
>礼!
> 				
>
>        梅劲松
>        info at xichen.com
>          2004-09-06
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
>
= = = = = = = = = = = = = = = = = = = =
			
        致
礼!
 
				 
        梅劲松
        info at xichen.com
          2004-09-06
Zeuux © 2025
京ICP备05028076号