from abc import ABC, abstractmethod
class TextPrinter(ABC):
@abstractmethod
def print_text(self):
pass
class PlainTextPrinter(TextPrinter):
def __init__(self, text):
self.text = text
def print_text(self):
print(self.text)
class TextDecorator(TextPrinter):
def __init__(self, text_printer):
self.text_printer = text_printer
def print_text(self):
self.text_printer.print_text()
class BoldTextDecorator(TextDecorator):
def print_text(self):
print(f"<b>{self.text_printer.print_text()}</b>")
class ItalicTextDecorator(TextDecorator):
def print_text(self):
print(f"<i>{self.text_printer.print_text()}</i>")
# Client code
if __name__ == "__main__":
plain_printer = PlainTextPrinter("Hello, world!")
bold_printer = BoldTextDecorator(plain_printer)
italic_bold_printer = ItalicTextDecorator(bold_printer)
plain_printer.print_text()
bold_printer.print_text()
italic_bold_printer.print_text()
@pythonl
Please open Telegram to view this post
VIEW IN TELEGRAM
Получение информации о домене. с помощью Python.
$pip install whois
$pip install whois
>>> import whois
>>> domain = whois.query('google.com')
>>> print(domain.__dict__)
{
'expiration_date': datetime.datetime(2020, 9, 14, 0, 0),
'last_updated': datetime.datetime(2011, 7, 20, 0, 0),
'registrar': 'MARKMONITOR INC.',
'name': 'google.com',
'creation_date': datetime.datetime(1997, 9, 15, 0, 0)
}
>>> print(domain.name)
google.com
>>> print(domain.expiration_date)
2024-09-14 00:00:00
• Github@pythonl
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
🤖 PythonRobotics: Python codes for robotics algorithm.
Python-код для алгоритма робототехники.
git clone https://github.com/AtsushiSakai/PythonRobotics.git
▪ Github
@pythonl
Python-код для алгоритма робототехники.
git clone https://github.com/AtsushiSakai/PythonRobotics.git
▪ Github
@pythonl
🕵 VTScanner
VTScanner is a versatile Python tool that empowers users to perform comprehensive file scans within a selected directory for malware detection and analysis.
Универсальный Python-инструмент, позволяющий выполнять комплексное сканирование файлов в выбранной директории для обнаружения и анализа вредоносных программ.
▪Github
@pythonl
VTScanner is a versatile Python tool that empowers users to perform comprehensive file scans within a selected directory for malware detection and analysis.
Универсальный Python-инструмент, позволяющий выполнять комплексное сканирование файлов в выбранной директории для обнаружения и анализа вредоносных программ.
git clone https://github.com/samhaxr/VTScanner.git
▪Github
@pythonl
This media is not supported in your browser
VIEW IN TELEGRAM
Through controlled breathing it is possible to regulate your body's stress reponse.
Интересный проект на Python. С помощью контроля дыхания можно регулировать реакцию организма на стресс. Данное приложение позволяет измерять и тренировать этот эффект с помощью монитора сердечного ритма Polar H10.
▪ Github
@pythonl
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM