i am trying to call a specific method by pressing a key for example: something like this: `
import keyboard
list = ["a","b","c"]
while True:
    try:
        if key.is_pressed('i'):
            list.index("a")
        elif key.is_pressed('c'):
            list.count("a")
    except:
        print("Error!")
I tried msvcrt library and found out it was only available for windows(I am using linux ubuntu 22.04) I also tried this link and it did not work.
 
     
    