Skip to content

Instantly share code, notes, and snippets.

@andrewsosa
Created October 18, 2017 14:11
Show Gist options
  • Save andrewsosa/3fff13e2156a37f07be0549a76412331 to your computer and use it in GitHub Desktop.
Save andrewsosa/3fff13e2156a37f07be0549a76412331 to your computer and use it in GitHub Desktop.
[DigitalOcean Web Console Login] #tags: digitalocean
from pynput.keyboard import Key, Controller
import time
keyboard = Controller()
# # Press and release space
# keyboard.press(Key.space)
# keyboard.release(Key.space)
#
# # Type a lower case A; this will work even if no key on the
# # physical keyboard is labelled 'A'
# keyboard.press('a')
# keyboard.release('a')
#
# # Type two upper case As
# keyboard.press('A')
# keyboard.release('A')
# with keyboard.pressed(Key.shift):
# keyboard.press('a')
# keyboard.release('a')
def enter():
keyboard.press(Key.enter)
keyboard.release(Key.enter)
def type(text):
keyboard.type(text)
enter()
time.sleep(2)
def countdown(count):
for i in range(count):
print i
time.sleep(1)
# keyboard.type('username')
# # time.sleep(2)
# keyboard.type('password')
# time.sleep(2)
countdown(5)
# time.sleep(5)
type('username')
type('oldpassword')
type('oldpassword')
type('newpassword')
type('newpassword')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment