打开和关闭案件 [英] open and shut case

查看:73
本文介绍了打开和关闭案件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

python可以关闭它自己打开的Web浏览器窗口吗?有问题的窗口

将显示一个驻留在本地计算机上的网页,这是运行Windows 98的
。知道一种方法可以帮助我。


和平

Can python close a web-browser window it opened itself? The window in question
will be displaying a webpage that resides on the local computer, which is
running Windows 98. Knowing a way to do this would really help me out.

Peace

推荐答案

Elaine Jackson写道:
Elaine Jackson wrote:
可以python关闭一个它自己打开的网页浏览器窗口?有问题的窗口
将显示一个驻留在本地计算机上的网页,该网页运行Windows 98.知道一种方法可以帮助我。
Can python close a web-browser window it opened itself? The window in question
will be displaying a webpage that resides on the local computer, which is
running Windows 98. Knowing a way to do this would really help me out.




不容易。我猜这样的事情可行,如果你有Mark

安装了Hammonds win32扩展程序:


(非常未经测试)


import os,win32api

#start browser

pid = os.spawnlp(os.P_NOWAIT," iexplore.exe"," iexplore.exe",

r" c:\ blabla \ hj.html")

#...

#kill browser

win32api.TerminateProcess(pid,0)

HTH


Erik



Not easily. I guess something like this could work, if you have Mark
Hammonds win32 extensions installed:

(very untested)

import os, win32api
# start browser
pid = os.spawnlp(os.P_NOWAIT, "iexplore.exe", "iexplore.exe",
r"c:\blabla\hej.html")
# ...
# kill browser
win32api.TerminateProcess(pid, 0)
HTH

Erik


"伊莱恩杰克逊 < EL *************** @ home.com>写道:
"Elaine Jackson" <el***************@home.com> writes:
python可以关闭它自己打开的Web浏览器窗口吗?有问题的窗口
将显示一个驻留在本地计算机上的网页,该网页运行Windows 98.知道一种方法可以帮助我。
Can python close a web-browser window it opened itself? The window in question
will be displaying a webpage that resides on the local computer, which is
running Windows 98. Knowing a way to do this would really help me out.




如果你知道要查找什么,有很多关于自动化IE的例子,如果你知道要查找什么,那么在Google和Google网上论坛上使用COM就好了。

不幸的是,COM在很多方面都比较模糊。


术语:IE,MSIE,Internet Explorer,COM,pywin32,win32all,ctypes


win32邮件列表(我忘了他的名字 - 对不起!)是一个很好的

来源。


PS。这些天,你的主题听起来明显是垃圾邮件

(特别是因为这是一个女人将消息发布到

comp。新闻组 - 这有多大可能? - )

John



There are quite a few examples of automating IE with COM lying around
on Google and Google Groups if you know what to look for.
Unfortunately, COM is be rather obscure in many ways.

terms: IE, MSIE, Internet Explorer, COM, pywin32, win32all, ctypes

The win32 mailing list (whose name I forget -- sorry!) is a good
source.

PS. these days, your subject line sounds distinctly spammish
(especially since it''s a woman posting the message to a
comp. newsgroup -- how likely can that be? ;-)
John


感谢您的提示。主题是幽默和诡异。我猜想我现在应该知道,当有很多较低的生命形态无法想象更好的东西时,尝试幽默并不值得付出代价。不要在泳池里撒尿。 C''est la vie,我想。无论如何,再次感谢。


和平


" John J. Lee" < jj*@pobox.com>在留言新闻中写道:87 ************ @ pobox.com ...

| 伊莱恩杰克逊 < EL *************** @ home.com>写道:

|

| > python可以关闭它自己打开的Web浏览器窗口吗?窗口中

问题

| >将显示驻留在本地计算机上的网页,即

| >运行Windows 98.知道一种方法可以帮助我。

|

|有很多关于使用COM自动化IE的例子

|如果您知道要查找的内容,请访问Google和Google网上论坛。

|不幸的是,COM在很多方面都相当模糊。

|

|术语:IE,MSIE,Internet Explorer,COM,pywin32,win32all,ctypes

|

| win32邮件列表(我忘了他的名字 - 对不起!)是一个很好的

|来源。

|

| PS。这些天,你的主题听起来明显是垃圾邮件

| (特别是因为这是一个女人将消息发布到

| comp。新闻组 - 这有多大可能??-)

|

|

|约翰
Thanks for the tips. The subject lines were meant to be humorous and hooky. I
guess I should know by now that it doesn''t pay to attempt humor when there are
so many lower lifeforms around who can''t imagine anything better to do than
peeing in the pool. C''est la vie, I guess. Anyway, thanks again.

Peace

"John J. Lee" <jj*@pobox.com> wrote in message news:87************@pobox.com...
| "Elaine Jackson" <el***************@home.com> writes:
|
| > Can python close a web-browser window it opened itself? The window in
question
| > will be displaying a webpage that resides on the local computer, which is
| > running Windows 98. Knowing a way to do this would really help me out.
|
| There are quite a few examples of automating IE with COM lying around
| on Google and Google Groups if you know what to look for.
| Unfortunately, COM is be rather obscure in many ways.
|
| terms: IE, MSIE, Internet Explorer, COM, pywin32, win32all, ctypes
|
| The win32 mailing list (whose name I forget -- sorry!) is a good
| source.
|
| PS. these days, your subject line sounds distinctly spammish
| (especially since it''s a woman posting the message to a
| comp. newsgroup -- how likely can that be? ;-)
|
|
| John


这篇关于打开和关闭案件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆