Things you’re probably not using in Python 3, but should. #article#tutorial#python @thedevs https://kutt.it/zbT47k
TGINSIGHT SIMILAR POSTS
Buscar contenido similar
Canal fuente @python_academy · Post #1565 · 31 dic
Придаем человеческий вид данным с помощью пакета humanize Открыл для себя потрясающийинструмент — пакет humanize, который превращает числа и даты в понятный для человека текст. Вместо того чтобы изобретать велосипеды для таких задач, этот пакет позволяет справиться с ними буквальноводнойстроке. Например, сложный объект timedelta может быть преобразован в "2 дня, 1 час и 33.12 секунд". Однако, что еще более впечатляет, — помимо английского, этот пакет поддерживаетмножество других языков, включая русский. Настоятельно рекомендую ознакомиться с их документацией, где представлено множество интересных функций. Пример использования в Python: import humanize from datetime import timedelta time_difference = timedelta(days=2, hours=1, seconds=33.12) humanized_time = humanize.naturaldelta(time_difference) print(humanized_time) # Output: 2 days, 1 hour and 33.12 seconds number_to_humanize = 500 humanized_number = humanize.intword(number_to_humanize) print(humanized_number) # Output: 5.00 x 10² В данном примере мы используем функции naturaldelta и intword из пакета humanize для получениячитаемых представлений временного интервала и числа соответственно. #python#humanize
1,002 posts similares encontrados
Búsqueda global general
Making Python programs blazingly fast. #article#tutorial#python @thedevs https://kutt.it/wyxPbe
Python dictionaries 101: A detailed visual introduction. #article#tutorial#python @thedevs https://kutt.it/6vMhMs
Easy concurrency in Python. #article#tutorial#python @thedevs https://kutt.it/jKBJgR
Python tricks 101, what every new programmer should know. #article#tutorial#python @thedevs https://kutt.it/hqWLKd
Python built-ins worth learning. #article#tutorial#python @thedevs https://kutt.it/gXmqrz
The 10 most common mistakes that Python developers make. #article#tutorial#python @thedevs https://kutt.it/5F70lT
Python Patterns, list of Python-specific patterns and how to implement them. #article#tutorial#python @thedevs https://kutt.it/cnDv7W
Clean architectures in Python: a step-by-step example. #article#tutorial#python @thedevs https://kutt.it/4cHcFT
How to write a Python web framework. #article#tutorial#python @thedevs https://kutt.it/cg7yVR
Async IO in Python, a complete walkthrough. #article#tutorial#python @thedevs https://kutt.it/JYI8em
Speed up your Python program with concurrency. #article#tutorial#python @thedevs https://kutt.it/vsS0Gl