wsh and Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Josty

    #1

    wsh and Python

    Hello

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

    def close_softawre( "name")
    shell = win32com.client .Dispatch("WScr ipt.Shell")
    shell.AppActiva te ("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.AppAct ivate ("name") = FALSE
    wscript.sleep 100
    loop

    Thank a lot

    a french guy


  • Roger Upole

    #2
    Re: wsh and Python

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

    while not shell.AppActiva te(name):
    win32api.Sleep( 100)

    Roger

    "David Josty" <dav.josty@pase mail> wrote in message
    news:42583de2$0 $6791$626a14ce@ news.free.fr...[color=blue]
    > Hello
    >
    > I have this function :
    > --------------------------------------------------------
    > import sys
    > import win32com.client
    > import win32api
    >
    > def close_softawre( "name")
    > shell = win32com.client .Dispatch("WScr ipt.Shell")
    > shell.AppActiva te ("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.AppAct ivate ("name") = FALSE
    > wscript.sleep 100
    > loop
    >
    > Thank a lot
    >
    > a french guy
    >
    >[/color]




    ----== 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 =---

    Comment

    Working...