In Windows 10 you can create multiple desktops and switch between them. I want to run a python3 code when I am on a certain desktop. How do I detect which desktop I'm on?
Download the VirtualDesktopAccessor.dll from here and put it in your working directory.
Run the following code:
import ctypes
vda = ctypes.WinDLL("VirtualDesktopAccessor.dll")
num = vda.GetCurrentDesktopNumber()
print(num)