Posts

GUESSING A GIVEN PASSWORD RANDOMLY USING PYTHON

 # importing random from random import * # taking input from user user_pass = input("Enter your password") # storing alphabet letter to use thm to crack password password = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k',             'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't','u','v',             'w', 'x', 'y', 'z',] # initializing an empty string guess = "" # using while loop to generate many passwords untill one of # them does not matches user_pass while (guess != user_pass):     guess = ""     # generating random passwords using for loop     for letter in range(len(user_pass)):         guess_letter = password[randint(0, 25)]         guess = str(guess_letter) + str(guess)     # printing guessed passwords     print(guess)           # printing t

PROGRAM TO ENCYRPT AND DECRYPT A PASSWORD USING PYTHON

 from cryptography.fernet import Fernet gen_key=Fernet.generate_key() fer=Fernet(gen_key) message="password type here!!!!" encrypted=fer.encrypt(message.encode()) print(encrypted) decrypted=fer.decrypt(encrypted) print(decrypted)

PROGRAM TO CALCULATE YOUR AGE USING PYTHON

 # importing the tkinter module from tkinter import * # importing date class from datetime module from datetime import date # initializing tkinter root = Tk() # setting the width and height of gui root.geometry("700x500") # setting the title of gui root.title("Age Calculator") # loading image photo = PhotoImage(file="wp2936933.png") # creating a Label widget to show the image we load myimage = Label(image=photo) # placing the image Label widget using grid method myimage.grid(row=0, column=1) # defining function to calculate age according to the data given # by the user def calculateAge():     # storing today's date in "today" variable     today = date.today()     # getting birthdate using .get() method     birthDate = date(int(yearEntry.get()), int(monthEntry.get()), int(dayEntry.get()))     # calculating age by subtracting birthdate from today's date     age = today.year - birthDate.year - ((today.month, today.day) < (birthDate.month,

PYTHON BASIC TOPICS

Image
                                                                    PYTHON Introduction:-                Python is an popular programming language.It was created by Guido Van Rossum,and released in 1991.It supports object oriented programmming approach to develop applications. It is used for: =>Web development =>software development =>system scripting $ Python is processed at run time by interpreter. $ The line which starts with >>>, is known as python prompt.  Advantages or characteristics of python or why python? :- $ Python works on different platforms(windows,linux,mac,etc..). $ python has simple syntax similar to english language. $ Python is easy to learn yet powerful and versatile scripting language. $ Python supports multiple programming pattern,including object oriented,imperative and functional        or procedural programming styles. $ We don't need to use data types to declare variable because it is dynamically typed. $ Python makes the development and

MY JARVIS CODE USING PYTHON

  import  pyttsx3 import  datetime import  speech_recognition  as  sr import  wikipedia import  webbrowser import  os import  webbrowser  as  wb import  smtplib from  selenium  import  webdriver from  selenium.webdriver.common.keys  import  Keys import  time import  subprocess import  winsound def  talktome(audio):     print(audio)     tts=gTTs(text=audio,language= 'en' )     tts.save( 'audio.mp3' )     os.system( 'mpg123 audio.mp3' ) engine=pyttsx3.init( 'sapi5' ) voices=engine.getProperty( 'voices' ) engine.setProperty( 'voice' ,voices[ 0 ].id) def  speak(audio):     engine.say(audio)     engine.runAndWait() def  wishMe():      hour=int(datetime.datetime.now().hour)       if  hour>= 0   and  hour< 12 :          speak( "good morning sir!" )          speak( "the weather is nice today!" )       elif  hour>= 12   and  hour< 18 :              speak( "Good Afternoon sir!" )              speak(  "