Simple python script with pyinstaller to bring a windows application in foreground
run pyinstaller main.py --onefile while in the same directory as main.py
pyinstaller
pywin32
Download the files in the executable folder. Make sure config.ini and Focus_desktop.exe is in the same folder, change window_name in config.ini to whatever window you want to bring into focus, is case sensitive
Code from https://stackoverflow.com/questions/2090464/python-window-activation