2004年09月04日 星期六 16:33
我的弟弟不太听话,现在我想通过python学习做个小软件,我就可以管好我的弟弟,也可以让自已练习一下基本功,软件的功能很简单,做一个自动启动的后台程序,我弟在浏览的地址栏中输入网址,在打开网页的同时,可以将这个网址传到我的后台程序中并记录在一个记事本中,现在我搞不明白,python如何可以截获输入的网址。请问这个后台小软件会很难做吗?如何进行截获输入的网址? ------------------------------------------------------------------------------------- 周杰伦在"第一现场"与你面对面 http://smspop.163.com/special/jay200408/index2.html
2004年09月04日 星期六 17:20
1、我认为你应该监视历史文件夹,XP里面似乎并没有以前那种专门保留曾输入网址的 文件 2、也许可以用INSTSRV.EXE和SRVANY.EXE这两个实用程序将你的脚本变成系统服务程序 ,去微软网站上面找 3、如果你愿意分析封包的话,找本防火墙的书看看 >From: "笑剑飞霜" <1238168 at 163.com> >Reply-To: python-chinese at lists.python.cn >To: python-chinese at lists.python.cn >Subject: [python-chinese] 练习做个小软件的问题请教 >Date: Sat, 4 Sep 2004 16:33:16 +0800 (CST) > >我的弟弟不太听话,现在我想通过python学习做个小软件,我就可以管好我的弟弟,也 可以让自已练习一下基本功,软件的功能很简单,做一个自动启动的后台程序,我弟在 浏览的地址栏中输入网址,在打开网页的同时,可以将这个网址传到我的后台程序中并 记录在一个记事本中,现在我搞不明白,python如何可以截获输入的网址。请问这个后 台小软件会很难做吗?如何进行截获输入的网址? > >------------------------------------------------------------------------------------- >周杰伦在"第一现场"与你面对面 http://smspop.163.com/special/jay200408/index2.html >_______________________________________________ >python-chinese list >python-chinese at lists.python.cn >http://python.cn/mailman/listinfo/python-chinese _________________________________________________________________ 免费下载 MSN Explorer: http://explorer.msn.com/lccn/
2004年09月04日 星期六 22:39
给你个示例代码,具体的功能你自己扩充。
import win32gui
import win32com
import win32com.client
import pythoncom
import time
class test:
def tt(self):
print 'tt'
class EventHandler(test):
def init(self):
ie =
win32com.client.DispatchWithEvents("InternetExplorer.Application",
EventHandler)
ie.Visible = 1
ie.Navigate("www.aawns.com")
# Important you have to pump messages in some way, because the
# COM event mechanism depends on using window messages to dispatch
# incoming calls
#print pythoncom.PumpMessages()
print dir(ie)
pythoncom.PumpMessages()
#~ while ie.Visible:
#~ time.sleep(2)
#~ print 'looping'
ie.Quit()
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):
print "documentComplete of %s" % URL
self.url=URL
self.tt()
a=EventHandler()
a.init()
笑剑飞霜的信件内容:
> 我的弟弟不太听话,现在我想通过python学习做个小软件,我就可以管好我的弟弟,也可以让自已练习一下基本功,软件的功能很简单,做一个自动启动的后台程序,我弟在浏览的地址栏中输入网址,在打开网页的同时,可以将这个网址传到我的后台程序中并记录在一个记事本中,现在我搞不明白,python如何可以截获输入的网址。请问这个后台小软件会很难做吗?如何进行截获输入的网址?
>
> -------------------------------------------------------------------------------------
> 周杰伦在"第一现场"与你面对面 http://smspop.163.com/special/jay200408/index2.html
2004年09月04日 星期六 23:30
Hollo info: 思路就是通过 win32com 来调用IE 的组件, 进行自个儿的处理! 其实直接记录IE的历史记录完事儿! /******** [2004-9-4]23:29:22 ; info wrote: info <info at xichen.com>> 给你个示例代码,具体的功能你自己扩充。 info <info at xichen.com>> import win32gui info <info at xichen.com>> import win32com info <info at xichen.com>> import win32com.client info <info at xichen.com>> import pythoncom info <info at xichen.com>> import time info <info at xichen.com>> class test: info <info at xichen.com>> def tt(self): info <info at xichen.com>> print 'tt' info <info at xichen.com>> class EventHandler(test): info <info at xichen.com>> def init(self): info <info at xichen.com>> ie = info <info at xichen.com>> win32com.client.DispatchWithEvents("InternetExplorer.Application", info <info at xichen.com>> EventHandler) info <info at xichen.com>> ie.Visible = 1 info <info at xichen.com>> ie.Navigate("www.aawns.com") info <info at xichen.com>> # Important you have to pump messages in some way, because the info <info at xichen.com>> # COM event mechanism depends on using window messages to dispatch info <info at xichen.com>> # incoming calls info <info at xichen.com>> #print pythoncom.PumpMessages() info <info at xichen.com>> print dir(ie) info <info at xichen.com>> pythoncom.PumpMessages() info <info at xichen.com>> #~ while ie.Visible: info <info at xichen.com>> #~ time.sleep(2) info <info at xichen.com>> #~ print 'looping' info <info at xichen.com>> ie.Quit() info <info at xichen.com>> def OnVisible(self, visible): info <info at xichen.com>> global bVisibleEventFired info <info at xichen.com>> bVisibleEventFired = 1 info <info at xichen.com>> def OnDownloadBegin(self): info <info at xichen.com>> print "DownloadBegin" info <info at xichen.com>> def OnDownloadComplete(self): info <info at xichen.com>> print "DownloadComplete" info <info at xichen.com>> def OnDocumentComplete(self, pDisp = pythoncom.Missing , URL = info <info at xichen.com>> pythoncom.Missing): info <info at xichen.com>> print "documentComplete of %s" % URL info <info at xichen.com>> self.url=URL info <info at xichen.com>> self.tt() info <info at xichen.com>> a=EventHandler() info <info at xichen.com>> a.init() info <info at xichen.com>> 笑剑飞霜的信件内容: >> 我的弟弟不太听话,现在我想通过python学习做个小软件,我就可以管好我的弟弟,也可以让自已练习一下基本功,软件的功能很简单,做一个自动启动的后台程序,我弟在浏览的地址栏中输入网址,在打开网页的同时,可以将这个网址传到我的后台程序中并记录在一个记事本中,现在我搞不明白,python如何可以截获输入的网址。请问这个后台小软件会很难做吗?如何进行截获输入的网址? >> >> ------------------------------------------------------------------------------------- >> 周杰伦在"第一现场"与你面对面 >> http://smspop.163.com/special/jay200408/index2.html info <info at xichen.com>> _______________________________________________ info <info at xichen.com>> python-chinese list info <info at xichen.com>> python-chinese at lists.python.cn info <info at xichen.com>> http://python.cn/mailman/listinfo/python-chinese ********************************************/ -- Free as in Freedom Zoom.Quiet #=========================================# ]Time is unimportant, only life important![ #=========================================# sender is the Bat!2.12.00
Zeuux © 2025
京ICP备05028076号