Python Forum
How do I activate my script when another program opens?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I activate my script when another program opens?
#1
let's say I have program A (a default program in windows) and I have Script B (a python script but I wanna make it executable) How can I execute(automatically) Script B when program A opens or starts,,,
Thank you... Smile
Reply
#2
Write a batch file:
    mybatch.bat
        start my_program.exe
        start python.exe test.py
Reply
#3
To elaborate on heiner55's post - a level of indirection (a batch file) would be thes simplest solution. If you really want something more, and are willing to put the effort into it, you can look into things such as this. You might also want to checkout Gray Hat Python or its sequel for other information on how to achieve it. It's basically black magic so you're less likely to find something sufficiently cookie-cutter that it wouldn't be a decent chunk of effort.
Reply
#4
After reading Gray Hat, you can read  Black Hat:
https://www.amazon.com/Black-Hat-Python-...bc?ie=UTF8
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can Not Activate Environment hammer 6 7,279 Mar-05-2022, 10:26 AM
Last Post: snippsat
  Python win32com.client: What are the syntax to open exe file & activate its window? JaneTan 0 4,190 Oct-14-2020, 09:09 AM
Last Post: JaneTan
  Activate Winodw/ Set focus biprabu 0 1,658 Sep-07-2020, 04:05 AM
Last Post: biprabu
  key = getkey() opens platforms.py Toolman 1 1,665 May-28-2020, 07:10 AM
Last Post: Gribouillis
  Why my program works from script but not from GUI? Matgaret 0 1,536 Dec-13-2019, 01:51 PM
Last Post: Matgaret
  How to write a script to execute a program need passing additional input? larkypython 2 2,523 Nov-23-2019, 04:38 AM
Last Post: larkypython
  How to launch a program through python script - Mac OS Mojave Aurimas 2 2,813 May-11-2019, 10:20 AM
Last Post: kritesh
  Auto activate conda env in Pycharm terminal ntuttle 0 4,770 Mar-08-2019, 03:56 PM
Last Post: ntuttle
  How do you specify which web browser opens? alec 0 1,711 Sep-09-2018, 04:43 AM
Last Post: alec
  virtualenv activate.ps1 hash error po20 2 3,818 Jan-13-2018, 09:21 AM
Last Post: po20

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020