Python

5 Amazing Python Tricks you should Know

In this post, we’ll talk about some tricks which come in handy when we’re in urgent need.

QR Code with Python

pip install pyqrcode
pip install pypng
import pyqrcode from pyqrcode 
import QRCode
import png
# String which represents the QR code
S= "www.geeksforgeeks.org"
# Generate QR code
url.pyqrcode.create(s)
# Create and save the svg file naming "myqr.svg" 
url.svg("myqr.svg", scale = 8)
# Create and save the png file naming "myqr.png" 
url.png ('myqr.png', scale = 6)

Convert Images with Python

pip install fpdf
from fpdf import FPDF 
pdf = FPDF () # imagelist is the list with all image 
for image in imagelist:
pdf.add_page()
pdf.image(image,x,y,w,h)
pdf.output("yourfile.pdf","F")

YouTube Video Download

pip install pytube
import pytube
link=input('Enetr YouTube Video URL')
yt=pytube.YouTube(link)
yt.streams.first().download()
print('Downloaded',link)

Send Emal Using Python

import smtplib
my_mail="test@gmail.com"
password="test@123"
connection=smtplib.SMTP("smtp@gmail.com",587)
connection.starttls()
connection.login(user=my_mail,password=password)
connection.sendmail("receiver@gmail.com",msg="Hello World")
connection.close()

Language Detection

pip install langdetect
from langdetect import detect
text=input("Enter text")
print(detect(text))
Important Notice for college students

If you’re a college student and have skills in programming languages, Want to earn through blogging? Mail us at geekycomail@gmail.com

For more Programming related blogs Visit Us Geekycodes. Follow us on Instagram.

Please subscribe to our Youtube Channel by clicking on the youtube icon given below

Leave a Reply

%d bloggers like this: