How my python script can know the platform name of device?

Hi,

Everything is in the title of this topic: “How my python script can know the platform name of device?”

Let me explain you the context for better understanding the purpose of my question.

I am coding a python test program which will run the test on several real smarthphones devices in parallel.

My code doesn’t have eyes to see if smartphones are Android or iOS or Microsoft.
Is there any code, library or module which can detect the usb connected devices and guess what are the OS(platformname) of each device?

Thanks for your help.