3 examples of 'python rotate screen' in Python

Every line of 'python rotate screen' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
249def set_rotation(self, rotation):
250 """
251 Set screen rotation.
252 Accepts values between 0-3, where 1 stands for clockwise 90 degree rotation,
253 2 for 180 degree rotation, etc.
254 """
255 self.buffer += "\e[%sr" % str(rotation)
256
257 if rotation % 2 == 0:
258 self.orientation = Screen.VERTICAL
259 else:
260 self.orientation = Screen.HORIZONTAL
261
262 self.sleep()
263
264 return self
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

65def OnRotateOutputR(self, event):
66 """ Rotate on the right for output ports.
67 """
68 index = self.dir.index(self.output_direction)
69 n = index + 1
70 self.output_direction = self.dir[n%len(self.dir)]
71
72 ### test if there is layering between input and output
73 if self.input_direction == self.output_direction:
74 n+=1
75 self.output_direction = self.dir[n%len(self.dir)]
139def _rotate(self, angle):
140 '''Change the current rotation'''
141 r = self.current_rotation + angle
142
143 if r == 360:
144 r = 0
145 if r < 0:
146 r += 360
147 elif r > 360:
148 r -= 360
149
150 self.current_rotation = r

Related snippets