1

I am very new to python and programming in general. I am trying to make a program that will print something if a key is pressed. I want it to work anytime while the program is running (using input or raw_input will not work). In my IDE (Visual Studio 2019) the word keyboard is underlined in green and when I hover over it a box says Unresolved import 'keyboard'.

How can this be fixed?

import keyboard
a = True
while a:
if keyboard.is_pressed('1'):
        print("Hello World")
Blonded
  • 137
  • 1
  • 11
Clueless
  • 11
  • 2
  • 2
    It seems [keyboard](https://pypi.org/project/keyboard/) is an third party library. Did you install it? Also if the error is only happening in the IDE but not when you run the program, you can probably ignore the error. – Paul Rooney Aug 18 '19 at 23:19

0 Answers0