This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def say_hi(): | |
return 'hi!' | |
def say_bye(): | |
return 'bye!' | |
def print_something(input_function): | |
print(input_function()) | |
print_something(say_hi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynput.keyboard import Controller | |
import random | |
import time | |
key_press_dict = { | |
0 : 'w', | |
1 : 'a', | |
2 : 's', | |
3 : 'd' |