'How can I find connected bluetooth devices using Socket Python?

I want to turn off bluetooth, when I disconnect my bluetooth headphones. I want to use Socket in Python, because I couldn't install PyBluez:

command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\link.exe' failed with exit code 1181

So, how can i check what device is connected to my laptop?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source