I'm new in python. I'm writing a code using input()
in while loop to get a char in console, but it stops when the input()
function is called (actually it is waiting an input). I want to run the loop regardless of the input, and code should be like this:
while True:
tmp = '0'
if (console.readable()):
tmp = input()
... #some tasks
This code is like the way I did with C for serial connection (readable() checks if something is in console buffer). I'm not sure even the 'console buffer thing' exists, or maybe there's another way to use callback function. I hope someone knows how to do this in python. Thanks!!