Skip to content

Instantly share code, notes, and snippets.

View ice1x's full-sized avatar

ice1x ice1x

  • Estonia
View GitHub Profile
@ice1x
ice1x / 1.srp.py
Created December 20, 2020 20:14 — forked from dmmeteo/1.srp.py
SOLID Principles explained in Python with examples.
"""
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
"""
class Animal:
def __init__(self, name: str):
@ice1x
ice1x / pycurses.py
Created February 14, 2018 22:36 — forked from claymcleod/pycurses.py
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()