停止弹出cmd窗口 [英] Stop popup cmd window
问题描述
如何在
屏幕上看到cmd弹出窗口,让这个脚本运行?该脚本运行良好,但每小时(当任务调度程序运行它时)会出现一个简短的cmd窗口然后消失。这只是在屏幕上显示一两秒,但这是显而易见的。
u ="用户名"
f =" from address"
t =" to address
fp = os.popen(" ipconfig / all", " r")
msg = MIMEText(fp.read())
fp.close()
msg [ 主题] ="%s'的IPconfig报告" %u
msg [" From"] = f
msg [" To"] = t
h =" ; smtp.vt.edu"
s = smtplib.SMTP(h)
s.sendmail(f,t,msg.as_string())
s.quit()
2003年12月15日13:28:01 -0800,hokiegal99写道:如何在
屏幕上看到cmd弹出窗口的情况下运行此脚本?该脚本运行良好,但每小时(当任务调度程序运行它时)会出现一个简短的cmd窗口然后消失。它仅在屏幕上显示一两秒,但它是显而易见的。
使用更好的操作系统? < 0.5 wink>
用pythonw.exe而不是python.exe运行它。
-
一个操作系统来统治它们,一个操作系统可以找到它们,
一个操作系统可以将它们全部带到黑暗中并绑定它们,
在雷德蒙德的土地上,阴影谎言。
www: http: //dman13.dyndns.org/~dman/ jabber: dm**@dman13.dyndns.org
>在2003年12月15日13:28:01 -0800,hokiegal99写道:如何在没有看到cmd弹出窗口的情况下运行此脚本屏幕?该脚本运行良好,但每小时(当任务调度程序运行它时)会出现一个简短的cmd窗口然后消失。它仅在屏幕上显示一两秒,但它是显而易见的。
使用更好的操作系统? < 0.5 wink>
用pythonw.exe而不是python.exe运行它。
如何在python上指定pythonw.exe 。可执行程序?任务安排程序没有地方用于此类事情。
ho ******** @ hotmail.com (hokiegal99)写道:
On 2003年12月15日13:28:01 -0800,hokiegal99写道:>如何在没有看到
>上的cmd弹出窗口的情况下运行此脚本?屏幕?该脚本运行良好,但每小时(当任务调度程序运行它时)会出现一个简短的cmd窗口然后消失。这只是在
>屏幕是一两秒,但它是显而易见的。
使用更好的操作系统? < 0.5 wink>
用pythonw.exe而不是python.exe运行它。
如何在python.exe上指定pythonw.exe?任务调度程序没有这方面的地方。
将脚本命名为''myscript.pyw''而不是''myscript.py' '。
Thomas
How can I make this script run w/o seeing a cmd popup window on the
screen? The script works well, but each hour (when the task scheduler
runs it) a brief cmd window appears and then goes away. It''s only on
the screen for a second or two, but it''s noticable.
u = "User Name"
f = "from address"
t = "to address"
fp = os.popen("ipconfig /all", "r")
msg = MIMEText(fp.read())
fp.close()
msg["Subject"] = "%s''s IPconfig Report" % u
msg["From"] = f
msg["To"] = t
h = "smtp.vt.edu"
s = smtplib.SMTP(h)
s.sendmail(f, t, msg.as_string())
s.quit()
On 15 Dec 2003 13:28:01 -0800, hokiegal99 wrote:How can I make this script run w/o seeing a cmd popup window on the
screen? The script works well, but each hour (when the task scheduler
runs it) a brief cmd window appears and then goes away. It''s only on
the screen for a second or two, but it''s noticable.
Use a better OS? <0.5 wink>
Run it with pythonw.exe instead of python.exe.
--
One OS to rule them all, one OS to find them,
One OS to bring them all and in the darkness bind them,
In the Land of Redmond, where the Shadows lie.
www: http://dman13.dyndns.org/~dman/ jabber: dm**@dman13.dyndns.org
> On 15 Dec 2003 13:28:01 -0800, hokiegal99 wrote:How can I make this script run w/o seeing a cmd popup window on the
screen? The script works well, but each hour (when the task scheduler
runs it) a brief cmd window appears and then goes away. It''s only on
the screen for a second or two, but it''s noticable.
Use a better OS? <0.5 wink>
Run it with pythonw.exe instead of python.exe.
How can I specify pythonw.exe over python.exe? The task scheduler has
no place for this sort of thing.
ho********@hotmail.com (hokiegal99) writes:
On 15 Dec 2003 13:28:01 -0800, hokiegal99 wrote:> How can I make this script run w/o seeing a cmd popup window on the
> screen? The script works well, but each hour (when the task scheduler
> runs it) a brief cmd window appears and then goes away. It''s only on
> the screen for a second or two, but it''s noticable.
Use a better OS? <0.5 wink>
Run it with pythonw.exe instead of python.exe.
How can I specify pythonw.exe over python.exe? The task scheduler has
no place for this sort of thing.
Name the script ''myscript.pyw'' instead of ''myscript.py''.
Thomas
这篇关于停止弹出cmd窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!