So I have a python3 command-line tool that I use for some stuff, but I can't always pay attention to it, so I set it up to print('\a')
when it wants to get my attention. This is nice, when I'm doing something else, but if I happen to be looking at the terminal it's running in, it's really annoying.
Is there a platform-independent way for a python3 script to tell if the terminal it's running in is in focus? Thanks in advance!