Skip to content

Instantly share code, notes, and snippets.

@codeboy
codeboy / tkinter_basic.py
Created November 10, 2020 15:28
Example of tkinter logging and api queries
from tkinter import Tk, RIGHT, BOTH, RAISED, Text, W, N, E, S, END
from tkinter.ttk import Frame, Button, Label, Style
from tkinter import scrolledtext
import requests
import json
from PIL import Image, ImageTk
import sys
class GuiBasic(Frame):
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
59f1ad60299b backend_socketio "./../entrypoint-soc…" 4 days ago Up 4 days 0.0.0.0:8082->8002/tcp, :::8082->8002/tcp
socketio
4bd8550b2968 bitnami/postgresql-repmgr:13 "/opt/bitnami/script…" 6 days ago Up 5 days 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp
matrix-db
3f13fb38be5e bitnami/phppgadmin:7 "/opt/bitnami/script…" 7 days ago Up 7 days 8080/tcp, 0.0.0.0:4443->8443/tcp, :::4443->8443/tcp pg_pgadm_1
7cef7a1d49aa backend_web
@codeboy
codeboy / html_tag_parsing.py
Created June 8, 2022 09:59
example of counting html tags
# Код для парсинга немного избыточен, однако так нагляднее
# Здесь добавление экшенов в кастомном парсере для подсчёта тегов
# Так же полный словарь с количеством каждого элемента
# тегов в коде главной страницы - count 1072
# из них содержит атрибуты - tags_with_attr 982
from html.parser import HTMLParser
from collections import defaultdict
from urllib.request import urlopen
@codeboy
codeboy / common_sortener.py
Created September 27, 2022 14:30
test common sortener
#!/usr/bin/env python
# Please create a Python code that will write the 3 most common words from the
# given list to standard output.
#
# Preferred output format is a list of (word, count) tuples, e.g.:
#
# $ python words.py
# [('apple', 5), ('banana', 4), ('orange', 3)]
#
# Ideally, the list should be sorted by word frequency.