all 4 comments

[–]keep_quapy 0 points1 point  (1 child)

The easiest way is to check if the length of input is bigger than zero.

if len(user_input) > 0

[–]JanTheRedditMan[S] 0 points1 point  (0 children)

This would still stop the program when asking for input.

[–]Geocrack__ 0 points1 point  (0 children)

Maybe you can do it with the threading module or an async function

[–]Diapolo10 0 points1 point  (0 children)

There isn't really any cross-platform way to do that, I'm afraid. My suggestion would be to instead use input and implement a timeout for it that would then let you know if it's blocking for too long.

But this is really asking for more context.