Skip to content

Instantly share code, notes, and snippets.

Avatar

Yousef Azizi yousefazizi1982

View GitHub Profile
@yousefazizi1982
yousefazizi1982 / chat_clnt.py
Created March 25, 2023 19:16 — forked from schedutron/chat_clnt.py
GUI client script for my chat app
View chat_clnt.py
#!/usr/bin/env python3
"""Script for Tkinter GUI chat client."""
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
import tkinter
def receive():
"""Handles receiving of messages."""
while True:
@yousefazizi1982
yousefazizi1982 / 1.srp.py
Created March 24, 2022 00:04 — forked from dmmeteo/1.srp.py
SOLID Principles explained in Python with examples.
View 1.srp.py
"""
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):