Skip to content

Instantly share code, notes, and snippets.

View MarkMichon1's full-sized avatar
😎

Mark Michon MarkMichon1

😎
  • Naperville, IL
View GitHub Profile
from pynput.keyboard import Controller
import random
import time
key_press_dict = {
0 : 'w',
1 : 'a',
2 : 's',
3 : 'd'
@MarkMichon1
MarkMichon1 / gist:c7dd1ff26cbf1fb39423a1455c4b8713
Created November 11, 2019 02:19
simple class demonstration
class Dog:
def __init__(self):
print('\nThis code is running because I am being initialized!')
self.something_else()
def something_else(self):
print('...And this is something else inside of the __init__!')
def then_this(self, some_input):
print('This is not in the init, but can still be called from using .then_this()')
@MarkMichon1
MarkMichon1 / .py
Created November 11, 2019 02:02
first class function example
def say_hi():
return 'hi!'
def say_bye():
return 'bye!'
def print_something(input_function):
print(input_function())
print_something(say_hi)