while True:
    barcode = input('Scan ISBN: ')
if len(barcode) > 1:
    logging.info('Recording scanned ISBN: ' + barcode)
print('Recording scanned ISBN: ' + barcode)
Python user input inside infinite loop too slow, easily confused