Muliti-language Translation In Python - Project.
pip install googletrans==4.0.0rc1
from googletrans import Translator
def translate_to_multiple_languages(sentence, target_languages):
translator = Translator()
translations = {}
for lang in target_languages:
output = translator.translate(sentence, dest=lang)
translations[lang] = output.text
return translations
sentence = input("Enter the sentence: ")
target_languages = input("Enter target languages separated by commas (e.g., en,fr,es): ").split(',')
translations = translate_to_multiple_languages(sentence, target_languages)
for lang, translation in translations.items():
print(f"Translation to {lang}: {translation}")
#code
🆔 @Python4all_pro
pip install googletrans==4.0.0rc1
from googletrans import Translator
def translate_to_multiple_languages(sentence, target_languages):
translator = Translator()
translations = {}
for lang in target_languages:
output = translator.translate(sentence, dest=lang)
translations[lang] = output.text
return translations
sentence = input("Enter the sentence: ")
target_languages = input("Enter target languages separated by commas (e.g., en,fr,es): ").split(',')
translations = translate_to_multiple_languages(sentence, target_languages)
for lang, translation in translations.items():
print(f"Translation to {lang}: {translation}")
#code
🆔 @Python4all_pro
Fun Python.pdf
1.5 MB
Fun Python
یادگیری جذاب پایتون با انجام پروژه های فان
بفرمایید پایتون😊 دیگه چه بهونه ای دارید که یادگیری رو شروع نکنید
این کتاب مخصوص افرادیه که حوصله فیلم آموزشی دیدن و خوندن کتابهای خسته کننده رو ندارند
#پروژه #pdf
🆔 @Python4all_pro
یادگیری جذاب پایتون با انجام پروژه های فان
بفرمایید پایتون😊 دیگه چه بهونه ای دارید که یادگیری رو شروع نکنید
این کتاب مخصوص افرادیه که حوصله فیلم آموزشی دیدن و خوندن کتابهای خسته کننده رو ندارند
#پروژه #pdf
🆔 @Python4all_pro
Python-Cheat-Sheet.pdf
2.3 MB
هر روز یک Cheat Sheet
برگه تقلب شماره ۶پایتون
Cheat Sheet 6: Python
#cheat_sheet #pdf
🆔 @Python4all_pro
برگه تقلب شماره ۶پایتون
Cheat Sheet 6: Python
#cheat_sheet #pdf
🆔 @Python4all_pro
🔅 Compress Images
#code
🆔 @Python4all_pro
from PIL import Image
# https://t.me/pythondevelopersindia
in_img = 'input.png'
out_img = 'compressed.png'
# Open the image
with Image.open(in_img) as img:
# Save the compressed image
img.save(out_img, 'PNG', quality=80)
print(f"Image compressed successfully!")
#code
🆔 @Python4all_pro
📘 یه منبع عالی برای مطالعه آنلاین و دانلود کتابهای پایتون
https://github.com/pamoroso/free-python-books
#pdf
🆔 @Python4all_pro
https://github.com/pamoroso/free-python-books
🆔 @Python4all_pro
GitHub
GitHub - pamoroso/free-python-books: Python books free to read online or download
Python books free to read online or download. Contribute to pamoroso/free-python-books development by creating an account on GitHub.
python_cheat_sheet.pdf
401.1 KB
چیت شیت شماره ۷ پایتون
‼️ باور کن خیلی مفیده
برگه های تقلب منبع بسیار مناسبی برای یادگیری زبانهای برنامه نویسی است
چیت شیت ها رو با هشتگ های زیر جستجو کنید
Cheat Sheet 7 : Python
#pdf
#SQL
#cheat_sheet
🆔 @Python4all_pro
‼️ باور کن خیلی مفیده
برگه های تقلب منبع بسیار مناسبی برای یادگیری زبانهای برنامه نویسی است
چیت شیت ها رو با هشتگ های زیر جستجو کنید
Cheat Sheet 7 : Python
#SQL
#cheat_sheet
🆔 @Python4all_pro
پایتون ( Machine Learning | Data Science )
🎁 تبریک تولد با استفاده از کد پایتون #code 🆔 @Python4all_pro
python
import turtle import random import time from pygame import mixer # Adding music is optional as per your choice. mixer.init() mixer.music.load("happy-birthday-song.mp3") # add your music file name or path # sets background bg = turtle.Screen() bg.bgcolor("black") mixer.music.play() # Bottom Line 1 turtle.penup() turtle.goto(-170, -180) turtle.color("white") turtle.pendown() turtle.forward(350) # Mid Line 2 turtle.penup() turtle.goto(-160, -150) turtle.color("white") turtle.pendown() turtle.forward(300) # First Line 3 turtle.penup() turtle.goto(-150, -120) turtle.color("white") turtle.pendown() turtle.forward(250) bg.bgcolor("lightgreen") # Cake turtle.penup() turtle.goto(-100, -100) turtle.color("white") turtle.begin_fill() turtle.pendown() turtle.forward(140) turtle.left(90) turtle.forward(95) turtle.left(90) turtle.forward(140) turtle.left(90) turtle.forward(95) turtle.end_fill() bg.bgcolor("lightblue") # Candles turtle.penup() turtle.goto(-90, 0) turtle.color("red") turtle.left(180) turtle.pendown() turtle.forward(20) turtle.penup() turtle.goto(-60, 0) turtle.color("blue") turtle.pendown() turtle.forward(20) turtle.penup() turtle.goto(-30, 0) turtle.color("yellow") turtle.pendown() turtle.forward(20) turtle.penup() turtle.goto(0, 0) turtle.color("green") turtle.pendown() turtle.forward(20) turtle.penup() turtle.goto(30, 0) turtle.color("purple") turtle.pendown() turtle.forward(20) bg.bgcolor("orange") # Decoration colors = ["red", "orange", "yellow", "green", "blue", "purple", "black"] turtle.penup() turtle.goto(-40, -50) turtle.pendown() for each_color in colors: angle = 360 / len(colors) turtle.color(each_color) turtle.circle(10) turtle.right(angle) turtle.forward(10) bg.bgcolor("red") # Happy Birthday message with bouncing animation turtle.penup() turtle.goto(-150, 50) turtle.color("yellow") turtle.pendown() # ENTER YOUR NAME IN THE NAME PLACE turtle.write(arg=f"Happy Birthday CodeWithRandom!", align="center", font=("jokerman", 20, "normal")) time.sleep(1.5) # Bouncing Animation for _ in range(7): turtle.penup() turtle.goto(-150, 50) turtle.pendown() turtle.clear() turtle.penup() turtle.goto(-150, 50 - _ * 10) turtle.pendown() turtle.write(arg=f"Happy Birthday CodeWithRandom!", align="left", font=("jokerman", 20, "normal")) time.sleep(0.5) turtle.done()
#code
🆔 @Python4all_pro
beginners_python_cheat_sheet_pcc_all.pdf
741 KB
Python cheatsheet for beginners
هر روز یک Cheat Sheet
برگه تقلب شماره ۸ پایتون
Cheat Sheet 8: Python
#cheat_sheet #pdf
🆔 @Python4all_pro
هر روز یک Cheat Sheet
برگه تقلب شماره ۸ پایتون
Cheat Sheet 8: Python
#cheat_sheet #pdf
🆔 @Python4all_pro
Coding Projects in Python.pdf
21.9 MB
Coding Projects in python for beginners
این کتاب هم مثل کتاب Fun Python که قبلا معرفی کردم برای شروع یادگیری پایتون مناسبه
#pdf
🆔 @Python4all_pro
این کتاب هم مثل کتاب Fun Python که قبلا معرفی کردم برای شروع یادگیری پایتون مناسبه
🆔 @Python4all_pro
ساخت ماشین حساب عشق با پایتون
در این پروژه یاد می گیرید چگونه با استفاده از کتابخانه Tkinter پایتون، یک ماشین حساب عشق بسازید.
ماشین حساب عشق یک برنامه ساده است که به شما امکان می دهد درصد عشق بین دو نفر را محاسبه کنید.
#code
🆔 @Python4all_pro
در این پروژه یاد می گیرید چگونه با استفاده از کتابخانه Tkinter پایتون، یک ماشین حساب عشق بسازید.
ماشین حساب عشق یک برنامه ساده است که به شما امکان می دهد درصد عشق بین دو نفر را محاسبه کنید.
#code
🆔 @Python4all_pro
Build a Love Calculator Using Pytho
#code
🆔 @Python4all_pro
from tkinter import *
import random
root = Tk()
# Defining the size, width=400, height=240
root.geometry('400x240')
# Title
root.title('Love Calculator❤️❤️')
def calculate_love():
# value will contain digits between 0-9
st = '0123456789'
# result will be in double digits
digit = 2
temp = "".join(random.sample(st, digit))
result.config(text=temp)
# Heading on Top
heading = Label(root, text='Love Calculator????')
heading.pack()
# Slot/input for the first name
slot1 = Label(root, text="Enter Your Name:")
slot1.pack()
name1 = Entry(root, border=5)
name1.pack()
# Slot/input for the partner name
slot2 = Label(root, text="Enter Your Curse Name:")
slot2.pack()
name2 = Entry(root, border=5)
name2.pack()
bt = Button(root, text="Calculate", height=1,
width=7, command=calculate_love)
bt.pack()
# Text on result slot
result = Label(root, text='Love Percentage between both of You:')
result.pack()
# Starting the GUI
root.mainloop()
#code
🆔 @Python4all_pro
Python-RegEx-Cheatsheet.pdf
368.4 KB
Python RegEx Cheatsheet with Examples
هر روز یک Cheat Sheet
برگه تقلب شماره ۹ پایتون
Cheat Sheet 9: Python
#cheat_sheet #pdf
🆔 @Python4all_pro
هر روز یک Cheat Sheet
برگه تقلب شماره ۹ پایتون
Cheat Sheet 9: Python
#cheat_sheet #pdf
🆔 @Python4all_pro
تمرین پایتون با جواب ویدیویی
یکی از روشهای یادگیری پایتون انجام دادن پروژه های کوچک و تمرین کردنه
این تمرینات به شما کمک می کنه مفاهیم تئوری پایتون را در عمل استفاده کنید که به یادگیری مفاهیم کمک میکنه
در ادامه چندتا پیج یوتیوب میفرستم با ویدیوهاش ( به زبان فارس هستند) تمرین کنید قطعا شما رو چند پله جلوتر از جایی که هستید می بره
https://youtu.be/yS0OQY0OOZ0?si=T04hx4LhMN8v-hQe
https://www.youtube.com/playlist?list=PLTlSvnm2JX3ojZzL-TjPwPS79D8ouFte_
https://www.youtube.com/playlist?list=PLYWFiggmBHJbOBx-LWxoHqfhgD6UP_ZgS
#پروژه
🆔 @Python4all_pro
یکی از روشهای یادگیری پایتون انجام دادن پروژه های کوچک و تمرین کردنه
این تمرینات به شما کمک می کنه مفاهیم تئوری پایتون را در عمل استفاده کنید که به یادگیری مفاهیم کمک میکنه
در ادامه چندتا پیج یوتیوب میفرستم با ویدیوهاش ( به زبان فارس هستند) تمرین کنید قطعا شما رو چند پله جلوتر از جایی که هستید می بره
https://youtu.be/yS0OQY0OOZ0?si=T04hx4LhMN8v-hQe
https://www.youtube.com/playlist?list=PLTlSvnm2JX3ojZzL-TjPwPS79D8ouFte_
https://www.youtube.com/playlist?list=PLYWFiggmBHJbOBx-LWxoHqfhgD6UP_ZgS
#پروژه
🆔 @Python4all_pro
Python Cheatsheet Pdf.pdf
1.7 MB
هر روز یک Cheat Sheet
برگه تقلب شماره ۱۰ پایتون
Cheat Sheet 10: Python
#cheat_sheet #pdf
🆔 @Python4all_pro
برگه تقلب شماره ۱۰ پایتون
Cheat Sheet 10: Python
#cheat_sheet #pdf
🆔 @Python4all_pro
مدیریت فایل پایتون:
بررسی حالتهای مختلف دسترسی به فایل موجود در پایتون
🔸r : It opens the file to read-only. The file pointer exists at the beginning.
🔸rb : It opens the file to read-only in the binary format.
🔸r+ : It opens the file to read and write both.
🔸rb+ : It opens the file to read and write both in the binary format.
🔸 w : It opens the file to write only. It overwrites the file if previously exists or creates a new one if no file exists with the same name.
🔸wb : It opens the file to write only in the binary format
🔸w+ : It opens the file to write and read both. It is different from r+ in the sense that it overwrites the previous file if one exists whereas r+ doesn’t overwrite the previously written file.
🔸wb+ : It opens the file to write and read both in the binary format
🔸a : It opens the file in the append mode.
🔸ab : It opens the file in the append mode in the binary format.
🔸a+ : It opens a file to append and read both.
🔸ab+ : It opens a file to append and read both in the binary format.
🆔 @Python4all_pro
بررسی حالتهای مختلف دسترسی به فایل موجود در پایتون
🔸r : It opens the file to read-only. The file pointer exists at the beginning.
🔸rb : It opens the file to read-only in the binary format.
🔸r+ : It opens the file to read and write both.
🔸rb+ : It opens the file to read and write both in the binary format.
🔸 w : It opens the file to write only. It overwrites the file if previously exists or creates a new one if no file exists with the same name.
🔸wb : It opens the file to write only in the binary format
🔸w+ : It opens the file to write and read both. It is different from r+ in the sense that it overwrites the previous file if one exists whereas r+ doesn’t overwrite the previously written file.
🔸wb+ : It opens the file to write and read both in the binary format
🔸a : It opens the file in the append mode.
🔸ab : It opens the file in the append mode in the binary format.
🔸a+ : It opens a file to append and read both.
🔸ab+ : It opens a file to append and read both in the binary format.
with open("hello.txt", "w+") as f:
f.write("Hello World")
f.seek(0)
print(f.read())
🆔 @Python4all_pro