简体   繁体   中英

Is there a way to get input() in python to auto enter?

I am writing a script that uses a barcode scanner to take input. Currently I can scan into the terminal, but then have to press enter to be able to do the next scan. I would like the be able to scan barcodes one after another without pressing enter.

enter image description here Should auto enter here, so that it is ready to take new input

enter image description here

Turns out my scanner is programmable and was able to change the \t at the end to a \n

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM