0

I am trying to take in a string from a barcode scanner that is eight digits long. For example "12345678" and if the correct barcode is scanned, then a function is called. I would like to be able to advance automatically when the barcode is scanned instead of having to press enter afterwards. Does anyone know of something similar to msvcrt.getch() that would take in a full string instead of a single character? Or a workaround?

2
  • Here is a way to limit the keyboard input to exactly n characters. As you say press enter I assume you have input on something like a keyboard so it might help Commented Sep 13, 2021 at 15:05
  • Can you share the code you have written? Commented Sep 19, 2021 at 23:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.