there's my code:
import sys
import keyboard
import rotatescreen
from time import sleep
pd = rotatescreen.get_primary_display()
angel = [90, 180, 270, 0]
for i in range(2):
for x in angel:
pd.rotate_to(x)
sleep(0.5)
if keyboard.is_pressed("p"):
sys.exit(0)
So the program is working very well, doing his task, but the last 2 lines just don't seem to work. When i press 'p' the program just finishes his work instead of stopping.