Publish scanned barcode and then read by the subscriber node
This is pretty simple, but I am new to this and I can't seem to find a way to do it. I have a USB barcode scanner (NOT QR code) and when I plug it into my Raspberry PI and scan a barcode it just prints the barcode number and the message: command not found. I want to be able to scan the barcode then the publisher sees it and publishes to a node, and then the subscriber sees that node and displays the barcode scanned.
Thank you in advance!
EDIT I forgot to mention this is done in Python. I've tried many different ways and followed many tutorials but I cannot find a way to do it.