old_contents: #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  
  from win32gui import GetWindowText, GetForegroundWindow
  
  def _get_active_window_title() -> str:
      return GetWindowText(GetForegroundWindow())
  
  def _get_active_process_name() -> str:
      return ""
  
  def get_active_window_information() -> dict:
      return {
          "TITLE": _get_active_window_title(),
          # "PID": ???
          # "COMMAND": ???
      }
  
  if __name__ == '__main__':
      import time
      import sys
      print(sys.version)
      while True:
          print(get_active_window_information())
          time.sleep(1)
  
  
new_contents: #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  
  from win32gui import GetWindowText, GetForegroundWindow
  
  def _get_active_window_title():
      return GetWindowText(GetForegroundWindow())
  
  def _get_active_process_name():
      return ""
  
  def get_active_window_information():
      return {
          "TITLE": _get_active_window_title(),
          # "PID": ???
          # "COMMAND": ???
      }
  
  if __name__ == '__main__':
      import time
      import sys
      print(sys.version)
      while True:
          print(get_active_window_information())
          time.sleep(1)
  
  
subject: remove python3 syntax elements - PyQt5 is still hard to get for Python3