0

I see a lot of answers to this question online, but the only solution I have found uses the msvcrt module that (as I understand it) is only available for Windows.

I am making a simple python console game and I want to stop the user from typing anything while the application is loading or playing a simple animation as it tends to break the program.

Example:

import time


#disable input here
print('hi')
time.sleep(3)
print('3 seconds have gone by')
#enable input

I don't want to let the user roll their face over the keyboard and make everything messy and ugly. I know mac is very strict about this kind of stuff, is it even possible?

1 Answers1

0

From the solution you linked I can see that you are only needing the msvcrt.getwch() function, so you could use the one from the getch module i.e. getch.getch().

meph
  • 662
  • 3
  • 10