473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Re: Launch an application and continue the script's execution

Gabriel Genellina wrote:
Start the application in a separate console (using `start "" bat_file`
might be the easiest way) and then, within your Python script, wait
until the new process is ready. The wmi module by Tim Golden can help
<http://tgolden.sc.sabren.com/python/wmi.html>
e.g. wait until Microsoft Word opens:

import wmi
c = wmi.WMI()
while not len(c.Win32_Process(name="winword.exe")):
sleep(500)
Just for information's sake, you can do this
a little more neatly in WMI:

<code>
import wmi

c = wmi.WMI ()
word_watcher = c.Win32_Process.watch_for (name="winword.exe")
winword = word_watcher ()

</code>

Actually, now I look it's not that much neater; it basically
pushes the polling into WMI itself. Still, it is at least an
alternative :)

TJG
Aug 27 '08 #1
0 1192

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bob Bedford | last post by:
I've a script that must "launch" an other script on some situations. firstscript.php: .... If ($newarticle) //launch secondscript.php .... The "secondscript.php" may take quite long, and is...
0
by: Jeff Cooper | last post by:
Hi folks, I have a small VB app and I've created a deployment project for it. At the end of installation I would like the user to get a prompt like "Run your new program now? yes/no" -- or...
1
by: Jo | last post by:
I am having a real problem with the Launch conditions in VS .NET and can only come to the conclusion that it is a bug. It states quite emphatically in the MSDN that Launch Conditions WILL be...
7
by: Christopher C | last post by:
I am using a C# winform to launch some apps for our students. Basically the user hits a button the form hides and the app is launched. When the app exits, the form is unhidden. I have a question on...
1
by: pmclinn | last post by:
The code below is generated by an application that allows you to put a Microsoft assistant on a webpage. I'm having a heck of a time trying to get this script to launch on a server side button...
8
by: Marcus | last post by:
I have this application I have made that I launch when the user logs into Windows XP. I would like to delay the launch of the application so that it starts 1 minute after the user has logged in. ...
5
by: ambitos | last post by:
Hi everyone! I need help for my web application I need make a button for launch a (window) application, autoroot, use javascript . I have the folling code function launch(name, date) {
1
BezerkRogue
by: BezerkRogue | last post by:
I have created a VB Script to synchronize software versions and then launch an application on the system it is run against. The script runs and generates no errors but will not launch the second...
7
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.