Python is a way to tell computers exactly what to do, using simple and clear language that is easy for humans to understand. In our webste, Okpediaa you can get intriguing content.
Table of Contents
What is Python ?
A user-friendly programming language that enables users to communicate with computers through clear and concise instructions, facilitating efficient task execution and innovative solutions.
5 Amazing Tricks
QR Code With Python
- pip install pyqrcode
- pip install pypng
Copied!# Import QR Code from pyqrcode import pyqrcode import png from pyqrcode import QRCode # String which represent thr QR code S = "www.geeksforgeeks.org" # Generate QR code url = pyqrcode.create(s) # Creates and save the svg file naming "myqr.svg" url.svg("myqr.svg", scale = 8) # Creates and save the png file naming "myrq.png" url.png('myqr.png', scale = 6)
Convert Images To PDF
- pip install fpdf
Copied!from fpdf import FPDF pdf = FPDF() # imagelist is the list with all picture filenames for image in imagelist: pdf.add_page() pdf.image(image,x,y,z) pdf.output("Yourfile.pdf","F")
YouTube Video Downloaded
- pip install pytube
Copied!# pip install pytube import pytube link = input(' Enter Youtube Video URL') yt = pytube. Youtube(link) yt.streams.first().download() print(' Downloaded', link)
Send Email Using Py-thon
Copied!import smtplib my_email="test@gmail.com " password = "test123" connection = smtplib.SMTP("smtp.gmail.com", 587) connection.starttis() connection.login(user = my_email, password = password) connecation.sendmail(from_addr=my_email,to_addrs="receipentemail@gmail.com",msg= " Hello World") connection.close()
Language Detection
- pip install langdetect
Copied!from langdetect import descry text = input(" Enter any text in any language") print(descry(text))
Leave a Reply