I'm working on a project with Raspberry Pi. I have two identical keyboard emulator devices as inputs. In my program, I need to know which one gave the input. Is there a way to do this in Python? Thank you!
Do you have control over these devices?  Could you change the USB protocol to something more reasonable, like a USB CDC ACM virtual serial port?
Do they have to by identical?  If not, I would do something simple like have one of the devices only send capital letters and have the other device only send lower-case, but I guess that doesn't extend so well if you need to send a number.
With two keyboard emulators, you have to worry about what happens if the messages overlap.  For example, if device 1 tries to type "banana" and device 2 tried to type apple, there is nothing to prevent your python program from reading something like "applbaneana".
Determine which USB device gives the input in Raspberry Pi