دوره رایگان پایتون دانشگاه MIT با ددلاین ۲۹ می. بالای یک میلیون نفر ثبت نام کردن و بنظرم فرصت خوبی برای شروع هست.
https://www.edx.org/learn/computer-science/massachusetts-institute-of-technology-introduction-to-computer-science-and-programming-using-python
🆔 @Python4all_pro
https://www.edx.org/learn/computer-science/massachusetts-institute-of-technology-introduction-to-computer-science-and-programming-using-python
🆔 @Python4all_pro
edX
MITx: Introduction to Computer Science and Programming Using Python. | edX
An introduction to computer science as a tool to solve real-world analytical problems using Python 3.5.
What will be the output of the code?
Anonymous Quiz
15%
Existing method called
37%
Overridden existing method called
26%
The code will raise a TypeError
12%
The code will raise an AttributeError
10%
None of the above
10 Python Projects with 10 Lines of Code
👉Password Protech PDF
👉Windows Notification
👉Merge Multiple PDF
👉Voice Recorder
👉Random Password Generator(App)
👉Audio Visualization Tool(GUI)
👉Extract mp3 from mp4
👉Link Shortener
👉Terminal Tricks
👉Birthday Reminder
https://morioh.com/a/7ffbf70ad17a/10-python-projects-with-10-lines-of-code
#پروژه
🆔 @Python4all_pro
👉Password Protech PDF
👉Windows Notification
👉Merge Multiple PDF
👉Voice Recorder
👉Random Password Generator(App)
👉Audio Visualization Tool(GUI)
👉Extract mp3 from mp4
👉Link Shortener
👉Terminal Tricks
👉Birthday Reminder
https://morioh.com/a/7ffbf70ad17a/10-python-projects-with-10-lines-of-code
#پروژه
🆔 @Python4all_pro
حذف بکگراند تصویر با پایتون
#code
🆔 @Python4all_pro
# pip install rembg pillow
from rembg import remove
from PIL import Image
input_path = "in.png"
output_path = "out.png"
input = Image.open(input_path)
output = remove(input)
output.save(output_path)
https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx
#code
🆔 @Python4all_pro
🔖Color Detection Using Python and OpenCV | Color Detection with Python
https://morioh.com/p/35907c154459?f=5c21fb01c16e2556b555ab32
#code
🆔 @Python4all_pro
https://morioh.com/p/35907c154459?f=5c21fb01c16e2556b555ab32
#code
🆔 @Python4all_pro
🔖30 Helpful Python Snippets You Should Learn Today
در این مقاله به طور خلاصه 30 قطعه کد کوتاه را مشاهده می کنید که در 30 ثانیه یا کمتر می توانید آنها را درک کرده و یاد بگیرید.
ترفندهای زیر در تمرینات کدنویسی روزانه شما مفید خواهد بود
https://morioh.com/a/271bc88c0100/30-helpful-python-snippets-you-should-learn-today
#code
🆔 @Python4all_pro
در این مقاله به طور خلاصه 30 قطعه کد کوتاه را مشاهده می کنید که در 30 ثانیه یا کمتر می توانید آنها را درک کرده و یاد بگیرید.
ترفندهای زیر در تمرینات کدنویسی روزانه شما مفید خواهد بود
https://morioh.com/a/271bc88c0100/30-helpful-python-snippets-you-should-learn-today
#code
🆔 @Python4all_pro
ChatTTS - generative text2speech model with an emphasis on realism
ChatTTS is a text-to-speech model designed specifically for conversational scenarios such as LLM assistant.
ChatTTS supports both English and Chinese (if relevant).
🖥 GitHub
👉 Hugging Face
👉 ChatTTS page
#code
#Python_tricks
#library
🆔 @Python4all_pro
import ChatTTS
from IPython.display import Audio
chat = ChatTTS.Chat()
chat.load_models()
texts = ["<PUT YOUR TEXT HERE>",]
wavs = chat.infer(texts, use_decoder=True)
Audio(wavs[0], rate=24_000, autoplay=True)
ChatTTS is a text-to-speech model designed specifically for conversational scenarios such as LLM assistant.
ChatTTS supports both English and Chinese (if relevant).
🖥 GitHub
👉 Hugging Face
👉 ChatTTS page
#code
#Python_tricks
#library
🆔 @Python4all_pro
تبدیل تصویر رنگی به خاکستری با پایتون
با استفاده از Python و کتابخانه PIL، تصاویر خود را به خاکستری تبدیل کنید
First, install the necessary module:
Then, use this script:
#code
#Python_tricks
#library
🆔 @Python4all_pro
با استفاده از Python و کتابخانه PIL، تصاویر خود را به خاکستری تبدیل کنید
First, install the necessary module:
pip install pillow
Then, use this script:
from PIL import Image
in_img = 'input.jpg'
out_img = 'grayscale.jpg'
# Open the image
with Image.open(in_img) as img:
# Convert the image to grayscale
grayscale_img = img.convert('L')
# Save the grayscale image
grayscale_img.save(out_img)
#code
#Python_tricks
#library
🆔 @Python4all_pro
اگر در حال یادگیری پایتون هستید، یکی از بهترین راه ها تمرین آموخته های خود با حل مسائل مختلف است.
در اینجا لیستی از بیش از 190 پروژه پایتون به همراه کد وجود دارد که به شما در حل مشکلات مختلف و بهبود مهارت های خود در پایتون کمک می کند!
لینک:
https://bit.ly/py-projects-with-code
#پروژه
🆔 @Python4all_pro
در اینجا لیستی از بیش از 190 پروژه پایتون به همراه کد وجود دارد که به شما در حل مشکلات مختلف و بهبود مهارت های خود در پایتون کمک می کند!
لینک:
https://bit.ly/py-projects-with-code
#پروژه
🆔 @Python4all_pro
Python script for PDF audio
#code
🆔 @Python4all_pro
# Importing necessary libraries
import PyPDF2
import pyttsx3
# Prompt user for the PDF file name
pdf_filename = input("Enter the PDF file name (including extension): ").strip()
# Open the PDF file
try:
with open(pdf_filename, 'rb') as pdf_file:
# Create a PdfFileReader object
pdf_reader = PyPDF2.PdfReader(pdf_file)
# Get an engine instance for the speech synthesis
speak = pyttsx3.init()
# Iterate through each page and read the text
for page_num in range(len(pdf_reader.pages)):
page = pdf_reader.pages[page_num]
text = page.extract_text()
if text:
speak.say(text)
speak.runAndWait()
# Stop the speech engine
speak.stop()
print("Audiobook creation completed.")
except FileNotFoundError:
print("The specified file was not found.")
except Exception as e:
print(f"An error occurred: {e}")
#code
🆔 @Python4all_pro
؛DeepChem - یادگیری عمیق برای کشف دارو، شیمی کوانتومی، علم مواد و زیست شناسی
—
؛DeepChem مجموعه ای عالی از ابزارهای منبع باز را ارائه می دهد که با استفاده از یادگیری عمیق برای کشف دارو، علم مواد، شیمی کوانتومی و زیست شناسی ساخته دیده است
🖥 GitHub
👉Tutorials
👉 Deep Learning Models from DeepChem
#Python_tricks
#library
🆔 @Python4all_pro
—
pip install deepchem
؛DeepChem مجموعه ای عالی از ابزارهای منبع باز را ارائه می دهد که با استفاده از یادگیری عمیق برای کشف دارو، علم مواد، شیمی کوانتومی و زیست شناسی ساخته دیده است
🖥 GitHub
👉Tutorials
👉 Deep Learning Models from DeepChem
#Python_tricks
#library
🆔 @Python4all_pro
تغییر نام خودکار فایلها با پایتون
#code
🆔 @Python4all_pro
import os
directory = 'path/to/your/folder'
prefix = 'image_'
# Iterate over files in the directory
for count, filename in enumerate(os.listdir(directory)):
new_name = f"{prefix}{count}.png"
src = f"{directory}/{filename}"
dst = f"{directory}/{new_name}"
# Rename the file
os.rename(src, dst)
#code
🆔 @Python4all_pro
This media is not supported in your browser
VIEW IN TELEGRAM
افزایش سرعت اجرای Pandas
انویدیا کتابخانه RAPIDS رو معرفی کرده که میتونه سرعت اجرای #Pandas رو تا ۱۵۰ برابر افزایش بده. این کتابخانه بهطور خودکار تشخیص میده که از GPU یا CPU استفاده میکنین و نیازی به تغییر کد نیست، فقط کافیه دستورات زیر رو به کدتون اضافه کنین:
GitHub : https://github.com/rapidsai/cudf
#library
#Python_tricks
🆔 @Python4all_pro
انویدیا کتابخانه RAPIDS رو معرفی کرده که میتونه سرعت اجرای #Pandas رو تا ۱۵۰ برابر افزایش بده. این کتابخانه بهطور خودکار تشخیص میده که از GPU یا CPU استفاده میکنین و نیازی به تغییر کد نیست، فقط کافیه دستورات زیر رو به کدتون اضافه کنین:
%load_ext cudf.pandas
import pandas as pd
GitHub : https://github.com/rapidsai/cudf
#library
#Python_tricks
🆔 @Python4all_pro
Pygal
؛Pygal یک کتابخانه برای تجسم داده ها با استفاده از SVG است که به شما امکان می دهد انواع نمودارهای تعاملی مانند نمودارهای خطی، ستونی و دایره ای بسازید.
این کتابخانه یک line_chart ایجاد می کند، چند سری داده به آن اضافه می کند، عنوان و برچسب های محور x را تنظیم می کند و نتیجه را در یک فایل SVG ذخیره می کند.
#library
#Python_tricks
🆔 @Python4all_pro
؛Pygal یک کتابخانه برای تجسم داده ها با استفاده از SVG است که به شما امکان می دهد انواع نمودارهای تعاملی مانند نمودارهای خطی، ستونی و دایره ای بسازید.
این کتابخانه یک line_chart ایجاد می کند، چند سری داده به آن اضافه می کند، عنوان و برچسب های محور x را تنظیم می کند و نتیجه را در یک فایل SVG ذخیره می کند.
#library
#Python_tricks
🆔 @Python4all_pro
گوگل یک کتابخانه ایجاد رابط کاربری سریع مبتنی بر پایتون( منبع باز ) به نام mesop دارد
که به صورت داخلی در Google برای ایجاد برنامه های داخلی توسط برنامه نویسانی که به خوبی با توسعه front-end آشنا نیستند نیز استفاده می شود
Docs: https://google.github.io/mesop/
GitHub: https://github.com/google/mesop
Checkout the Colab Notebook: https://colab.research.google.com/github/google/mesop/blob/main/notebooks/mesop_colab_getting_started.ipynb
GenAI/LLM support straight out of the box for Chat app in mesop 👉 Demo: https://google.github.io/mesop/demo/
#library
#Python_tricks
#python
🆔 @Python4all_pro
که به صورت داخلی در Google برای ایجاد برنامه های داخلی توسط برنامه نویسانی که به خوبی با توسعه front-end آشنا نیستند نیز استفاده می شود
pip3 install mesop
Docs: https://google.github.io/mesop/
GitHub: https://github.com/google/mesop
Checkout the Colab Notebook: https://colab.research.google.com/github/google/mesop/blob/main/notebooks/mesop_colab_getting_started.ipynb
GenAI/LLM support straight out of the box for Chat app in mesop 👉 Demo: https://google.github.io/mesop/demo/
#library
#Python_tricks
#python
🆔 @Python4all_pro
🖥 Python cheat sheet, which contains small scripts for solving everyday problems
By the way, here are some of them:
✔️ add the
✔️ clear output of differences between strings
📎
Ultimate Python Cheat Sheet: Practical Python For Everyday Tasks : link
#cheat_sheet #Python
🆔 @Python4all_pro
By the way, here are some of them:
✔️ add the
sample.txt
file to the .tar.gz
archive:import tarfile
with tarfile.open('sample.tar.gz', 'w:gz') as tar:
tar.add('sample.txt')
✔️ clear output of differences between strings
import difflib
diff = difflib.ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
'ore\ntree\nemu\n'.splitlines(keepends=True))
print(''.join(diff))
📎
Ultimate Python Cheat Sheet: Practical Python For Everyday Tasks : link
#cheat_sheet #Python
🆔 @Python4all_pro