Programming – Telegram
Programming
350 subscribers
501 photos
66 videos
50 files
186 links
سایت نداره این کانال اصلا
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
یه آموزش نسبتا کاربردی
با یه لایبرری داخلی پایتون
———————————
تو این آموزش با یکی از کتابخونه های داخلی خود پایتون (webbrowser) لینک وبسایتها رو داخل مرورگر باز کردیم
کاربردش کجا هست؟
مثلا شما یک برنامه ای ساختین و میخواین وقتی اجرا شد اون کاربر رو ببره به سایت شما یا داکیومنت اون برنامه که ساختین

-+-+-+-+--+-+-+-+-+-+-+-+-

A relatively practical tutorial
With an internal Python library
———————————
In this tutorial, we opened the link of websites in the browser with one of our internal Python libraries (webbrowser).
Where is it used?
For example, you created a program and you want to take that user to your site or the document of the program you created when it was executed.
https://fake-useragent.herokuapp.com/browsers/0.1.11
وب سرویس useragent فیک
تو یه لایبرری بود خواستین استفاده کنین
لایبرریشم این بود
fake-useragent

pip install fake-useragent
〽️ آموزش کانورت کردن سشن تلتون به سشن پایروگرام و برعکس
〽️ How to convert telethon session to pyrogram session and pyrogram session to telethon session (database session)

https://gist.github.com/m0h4mad/70098530a028ef8233353783a0e19804#file-session_convertor-py
Welcome To San Andreas
Young Maylay |@musicstar2|
آهنگی که هیچ وقت قدیمی نمیشه
👎1
Programming
سلام دوستان امیدوارم حالتون خوب باشه❤️ امروز میخوام آموزش OCR (استخراج متن از تصویر) در هوش مصنوعی رو با پایتون یادتون بدم. (خیلی راحت در سه خط کد). خب برای اینکار طبق عکس اول٬ باید برید این صفحه گیتهاب و نرم افزار مربوط به OCR رو دانلود و نصب کنید در یک…
〽️ tesseract ocr on GNU/LINUX using python3

Installation guide on GNU/LINUX:

Step 1:
install tesseract program:
on ubuntu/debian:
sudo apt-get install tesseract-ocr

on fedora:
sudo dnf install tesseract

on arch:
sudo pacman -Syu tesseract

Step 2:
install pytesseract library:
pip3 install pytesseract

〽️ آموزش بیرون کشیدن متن از فایل عکس با پایتون در سیستم عامل گنو لینوکس:

نحوه نصب در گنو لینوکس:

قدم اول:
نصب نرم افزار tesseract:
در اوبونتو/دبین:
sudo apt-get install tesseract-ocr

در فدورا:
sudo dnf install tesseract

آرچ:
sudo pacman -Syu tesseract

قدم دوم:
نصب کتابخانه pytesseract:
pip3 install pytesseract

@PySources
or you can pass **kwargs as dict like this:
a = argument_to_property(**{"test":"test", "other_test":"test"})

#OOP
#setattr
#getattr

@PySources
How to generate a random password using python ⚡️

چگونه با پایتون پسورد رندوم درست کنیم ⚡️

#password
#string
#random
#security

@PySources
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

@PySources
installation: pip install wget
usage:
from wget import download
url = "your url"
out = download(url)
print(out)

دانلود فایل با پایتون با ساده ترین روش
How to use .ini files in python ⚡️

چگونه با فایل هایی با پسوند .ini در پایتون استفاده کنیم ⚡️

#config
#ini
#configparser

@PySources
How to use .yaml files in python ⚡️

چگونه از فایل هایی با پسوند .yaml در پایتون استفاده کنیم ⚡️

#yaml

@PySources
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

~ نوشتن روی تصاویر با پایتون
calendar (built-in module)

ماژول داخلی calendar

#calendar

@PySources
استاد یه برنامه نویس باگ/ارور هاشه

Bugs/errors are masters of a programmer
• how to know type of files and MIME type with python
× mimetypes is a standard library

• نحوه تشخیص تایپ فایل ها و MIME تایپ فایل ها در پایتون
× mimetypes استاندارد لایبرری هست
New features related to type hints in python3 new version:

🔗 https://docs.python.org/3/whatsnew/3.10.html#new-features-related-to-type-hints

قابلیت جدید پایتون ۳ مربوط به تایپ هینت ها