import win32gui

import time

while True:
    
    if ((win32gui.GetWindowText(win32gui.GetForegroundWindow()).find("[~]") != -1)):
        print("Active")
        break
    else:
      print("Un-Active")

c3c94f648de18fb843255b948e040d07d6b335e7
<mask token>

<mask token>
while True:
    if win32gui.GetWindowText(win32gui.GetForegroundWindow()).find('[~]'
        ) != -1:
        print('Active')
        break
    else:
        print('Un-Active')

import win32gui
import time
while True:
    if win32gui.GetWindowText(win32gui.GetForegroundWindow()).find('[~]'
        ) != -1:
        print('Active')
        break
    else:
        print('Un-Active')

import win32gui

import time

while True:
    
    if ((win32gui.GetWindowText(win32gui.GetForegroundWindow()).find("[~]") != -1)):
        print("Active")
        break
    else:
      print("Un-Active")
