By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

wsh and Python

P: n/a
Hello

I have this function :
--------------------------------------------------------
import sys
import win32com.client
import win32api

def close_softawre("name")
shell = win32com.client.Dispatch("WScript.Shell")
shell.AppActivate ("name")
win32api.Sleep(100)
shell.SendKeys ("%{F4}")
---------------------------------------------------------
But sometimes i have any problemes, the programme is not activate a time !!!
==> this is wsh !! i don't know translate in python

Do while WshShell.AppActivate ("name") = FALSE
wscript.sleep 100
loop

Thank a lot

a french guy
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Since AppActivate returns a boolean, you should be able
to do something like this:

while not shell.AppActivate(name):
win32api.Sleep(100)

Roger

"David Josty" <dav.josty@pasemail> wrote in message
news:42**********************@news.free.fr...
Hello

I have this function :
--------------------------------------------------------
import sys
import win32com.client
import win32api

def close_softawre("name")
shell = win32com.client.Dispatch("WScript.Shell")
shell.AppActivate ("name")
win32api.Sleep(100)
shell.SendKeys ("%{F4}")
---------------------------------------------------------
But sometimes i have any problemes, the programme is not activate a time
!!!
==> this is wsh !! i don't know translate in python

Do while WshShell.AppActivate ("name") = FALSE
wscript.sleep 100
loop

Thank a lot

a french guy



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.