Hi I need help in detecting the space bar when pressed. My program listed below wont detect the space bar. I wont to put the contents of a text file on the screen and then copy that text by typing it - so when I press the corresponding key the program will print to screen that letter from my text. If I press the wrong letter nothing happens. IT WORKS FOR THE FIRST 2 LETTERS BUT THE PROGRAM WONT DETECT THE SPACE IN THE STRING WHEN I PRESS IT, IT JUST STOPS. So I need help so I can copy the whole String out using keyboad.read_key(). I'm writing a typing practice program for my first program. The text is: In the beginning The output is: I N
import keyboard
d = 0
e = 1
f = open("C:/BibNum/Paragraphs/TEST18.txt")
a = f.read().replace("\n","")
print(a)
f.close()
c = a[d:e]
while True:
c = a[d:e]
if keyboard.read_key()== c:
print (c)
d = d + 1
e = e + 1