import keyboard
from time import sleep
while True:
if keyboard.is_pressed('space'):
while True:
sleep (0.01)
keyboard.send('space')
import keyboard
from time import sleep
while True:
if keyboard.is_pressed('space'):
while keyboard.is_pressed('space'):
sleep (0.01)
keyboard.send('space')