pip install rotate-screen
#pip install rotate-screen
#pip install pywin32
import rotatescreen
import time
screen = rotatescreen.get_primary_display()
for i in range(50):
time.sleep(1)
screen.rotate_to(i*90 % 360)
import time
import rotatescreen
screen = rotatescreen.get_primary_display()
start = screen.current_orientation
for i in range(1, 10):
a = abs((start - i*90) % 360)
screen.rotate_to(a)
time.sleep(1)