Posts

Y.T Videos downloader [Python]

 Firstly install pytube module by typing "pip install pytube" in terminal  For downloading .py file :  alexjr.itch.io from pytube.cli import on_progress from pytube import YouTube import os video_url = input ( "Paste Link Here :" ) try : yt = YouTube(video_url , on_progress_callback =on_progress) yt.streams\ .filter( file_extension = 'mp4' )\ .get_highest_resolution()\ .download() except EOFError as err: print (err) else : print ( "Downloaded Successfully :)" )

Turtle in python

 Firstly install Turtle by typing in terminal : pip install pythonturtle And then run code # Python program to draw # Rainbow Benzene # using Turtle Programming import turtle colors = [ 'red' , 'purple' , 'blue' , 'green' , 'orange' , 'yellow' ] t = turtle.Pen() turtle.bgcolor( 'black' ) for x in range ( 360 ): t.pencolor(colors[x% 6 ]) t.width(x/ 100 + 1 ) t.forward(x) t.left( 59 )

Spam Bot In 6 lines

  import pyautogui , time time.sleep( 5 ) o = open ( "beescript" , 'r' ) for word in o: pyautogui.typewrite(word) pyautogui.press( "enter" ) I used this list to spam :https://web.njit.edu/~cm395/theBeeMovieScript/ You can use anything just copy it and make a new txt folder in pycharm or any ide and paste your list in it and that shit run this.

Convert PDF To Audiobook [Without Python]

  Why not do it the easier way? 1. Convert pdf to epub file. 2. Upload the epub file to google playbooks and then download it on the same app. 3. Use the read aloud feature and enjoy. If you dont known, how to convert ,simply search on google or any search engine 'pdf to epub' .Nowdays all things from photoeditor to any converter is available online Not able to find read aloud? After steps 1 and 2 . When u open the epub file and touch any page, u will find three vertical dots at the upper right corner. There u'll find the read aloud feature. And yeh you need to download ebook from phone not PC.Because there is no option to read aloud😅. Thank you

PDF to Audio

  import pyttsx3 import PyPDF2 book = open ( 'ExpertPython.pdf' , 'rb' ) pdfReader = PyPDF2.PdfFileReader(book) pages = pdfReader.numPages speaker = pyttsx3.init() for num in range ( 7 , pages): page = pdfReader.getPage(num) text = page.extractText() speaker.say(text) speaker.runAndWait()

Auto Type 'Bot'

import pyautogui import time pyautogui.FAILSAFE= False while True : time.sleep( 10 ) for i in range ( 0 , 100 ): pyautogui.move( 0 , 1 * 2 ) for i in range ( 0 , 1 ): pyautogui.press( 'enter' ) pyautogui.press( 'p' ) pyautogui.press( 'r' ) pyautogui.press( 'i' ) pyautogui.press( 'n' ) pyautogui.press( 't' ) pyautogui.press( '(' ) pyautogui.press( '"' ) pyautogui.press( 'H' ) pyautogui.press( 'i' ) pyautogui.press( ' ' ) pyautogui.press( ',' ) pyautogui.press( 'I' ) pyautogui.press( ' ' ) pyautogui.press( 'a' ) pyautogui.press( 'm' ) pyautogui.press( ' ' ) pyautogui.press( 'y' ) pyautogui.press( 'o' ) pyautogui.press( 'u' ) pyautogui.press(

Class in python

# 1st Example # Normal use of class as usually we do. # Space in not compulsory.I add space for your easy understanding. #Pass is use for to pass the programme .But not for pass the programme.Because ex=if you make a function means def so pass not need.But if there is nothing after class means empty then pass need to add. class Student: pass harry=Student() me=Student() harry.name= "Harry" harry.Standard= "All rounder" harry.whatisharry= "My SIR.If you are in searching any teacher or brother go to:https://www.youtube.com/codewithharry \n But only in hindi language so sad Lol" me.name= "Alex" me.Standard= "10th in 2020 Ok .who are reading this" me.whatisme= "A student in 2020 .Lol" print (harry.whatisharry) #2nd Example. Use of dict in class class Alex: pass alex=Alex() alex.name= "Alexxxxx" alex.fun= "In Programing" print (alex. __dict__ ) # 3rd Example. Use of init in class class Alex: def __in

Healthy Programmer .Exercise.7

from pygame import mixer from datetime import datetime from time import time def mplay (file , stopper): mixer.init() mixer.music.load(file) mixer.music.play() while True : userinput = input () if userinput == stopper: mixer.music.stop() break def logactivity (msg): with open ( "Your Acvivity" , "a" ) as f: f.write( f" { msg } { datetime.now() } " ) if __name__ == '__main__' : water= 5 eyes= 10 phy= 15 init_water = time() init_eyes = time() init_exercise = time() while True : if time() - water > init_water: print ( "It is water drinking time.Enter=completed for stop the alarm" ) mplay( 'water.mp3' , 'completed' ) logactivity( " \n Water drink at:" ) if time() - eyes > init_eyes: print ( "It is eyes excrise time.Enter=completed for stop the alarm" ) mplay( 'eye.mp3' , 'comp

Modules😊

# #Random module example # import random # list=[1,3,5,7,9,11] # choice=random.choice(list) # print(choice) # #Image module example . Use ' when covering not " . Always use from Pil import image,BEC It is syntax # from PIL import Image # im = Image.open('C:\\Users\\alex9\\OneDrive\\Pictures\\images.jpg') # im.show() #time # import time # inpot=input() # if inpot=="what is time": # times=time.asctime() # print(times) # else: # print("You entered wrong word")