Programming
Open in Telegram
517
Subscribers
No data24 hours
No data7 days
-730 days
Posts Archive
517
from PIL import Image, ImageDraw, ImageFont
def write(
text:str,
x_y:tuple,
color:tuple,
font_path:str, font_size:int,
file_input:str, file_output:str
) -> None:
img = Image.open(file_input)
draw = ImageDraw.Draw(img)
font = ImageFont.truetype(font_path, font_size)
draw.text(x_y, text, color, font)
img.save(file_output)
img.close()
~ how to write on images with python
~ نوشتن روی تصاویر با پایتون517
How to use
.yaml files in python ⚡️
چگونه از فایل هایی با پسوند .yaml در پایتون استفاده کنیم ⚡️
#yaml
✅ @PySources517
How to use
.yaml files in python ⚡️
چگونه از فایل هایی با پسوند .yaml در پایتون استفاده کنیم ⚡️
#yaml
✅ @PySources517
How to use
.ini files in python ⚡️
چگونه با فایل هایی با پسوند .ini در پایتون استفاده کنیم ⚡️
#config
#ini
#configparser
✅ @PySources517
Streaming download using
asyncio, aiohttp, aiofiles ⚡️:
🔗: https://gist.github.com/m0h4mad/34a56d41d44aedcd81ead8b60a83b53c
use asyncio.gather to download more asynchronously517
یه روش بذاریم که خیلی سریع فایلو دانلود کنه؟
به این صورته که فایلو تقسیم میکنه بین چند ترد
و هر ترد یه بخش فایلو دانلود میکنه
517
دانلود مولتی کانکشن مثل adm هم بذاریم؟
چندین فایل رو همزمان دانلود کنید
517
installation:
pip install wget
usage:
from wget import download
url = "your url"
out = download(url)
print(out)
دانلود فایل با پایتون با ساده ترین روش517
hurry.filesize is a good human readable file size module that help you to show byte sizes to users
hurry.filesize یک ماژول خوب برای نشان دادن سایز های بایتی به کاربران نرم افزار/سایت شما با خوانایی بالا
example:
>>> # pip3 install hurry.filesize
>>> from hurry.filesize import size, alternative
>>> size(1024, system=alternative)
'1 KB'
>>> size(1024 * 1024 * 3, system=alternative)
'3 MB'
————————————————
#human_readable_filesize
#filesize
#byte
#byte_size
✅ @PySources517
How to generate random password using python ⚡️
چگونه با پایتون پسورد رندوم درست کنیم ⚡️
#password
#string
#random
#security
✅ @PySources
