You can screw up your friend’s computer with just 6 lines of python code

Let’s get started!

Before getting started you need to have installed python on your system and we will need to use a python editor to write the code. I will use PyCharm you can use any other editor you have and the things should run just fine, but if you want to follow me then just click on this link and get the PyCharm community version for free and install it on your system.

pip install rotate-screen
import rotatescreen
screen = rotatescreen.get_primary_display()
screen.rotate_to(90)
pip install pypiwin32
import rotatescreen
screen = rotatescreen.get_primary_display()
screen.rotate_to(0)

Now that you are back to normal, here comes the fun part!

Let’s make a loop and make this program run indefinitely to make your friend completely mad at you. To do that, we just need to implement a for loop like so:

import rotatescreen
import time
screen = rotatescreen.get_primary_display()
for i in range(13):
time.sleep(1)
screen.rotate_to(i*90 % 360)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
RAZREXE

Data engineer by profession with the skill set of a hacker, and a tech writer during tea breaks :)