Posts

Showing posts from September, 2023

WiFi Hacking with python

Image
  WiFi Hacking python code: import subprocess try: profiles = [line.split(":")[1][1:-1] for line in subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="backslashreplace").split('\n') if "All User Profile" in line] print("{:<30}| {:<}".format("Wi-Fi Name", "Password")) print("----------------------------------------------") for profile in profiles: try: password = [line.split(":")[1][1:-1] for line in subprocess.check_output(['netsh', 'wlan', 'show', 'profile', profile, 'key=clear']).decode('utf-8', errors="backslashr eplace").split('\n') if "Key Content" in line][0] print("{:<30}| {:<}".format(profile, password)) except IndexError: print("{:<30}| {:<}".format(profile, "")) except subprocess.CalledProces

Swapping Two Variables in Python

Image
  Swap two variables python example code: a = 5 b = 10 a, b = b, a print ( "a:"  , a) print ( "b:", b)

Lambda Functions in Python

Image
  Lambda Functions Example Code add = lambda x, y: x + y result = add(3, 5) print("Result of addition:", result)

Calculate the Area of a Circle with PYTHON

Image
  Calculate the Area of a Circle import math radius = float ( input ( "Enter the radius of the circle: " )) area = math.pi * (radius ** 2 ) print ( "Area of the circle:" , area)

PASSWORD GENERATOR PYTHON BOT

Image
  PASSWORD GENERATOR BOT of PYTHON import random import string def generate_password (length): characters = string.ascii_letters + string.digits + string.punctuation password = '' .join( random. Choice (characters) for _ in range (length)) return password # Example usage to generate a 12-character password password = generate_password( 12 ) print (password) YOU CAN ALSO USE THIS ONE import random import string def generate_password(length, uppercase, lowercase, numbers, special):     # Generates a password with customizable options for length, complexity, and character types.     # Define the character sets for each type of character     character_sets = []     if uppercase:         character_sets.append(string.ascii_uppercase)     if lowercase:         character_sets.append(string.ascii_lowercase)     if numbers:         character_sets.append(string.digits)     if special:         character_sets.append(string.punctuation)     # Ensure the length of the password is

Simple Python Calculator

Image
Simple Python Calculator Code: num1 = int(input ("enter number") ) num2 = int(input ("enter number") ) action = str(input ("choose action: Add(a) Sub(s) Mult(m) Div(d) ->") ) print( "the result is", end="") if action == "a" : print(num1+num2) elif action == "s" : print(num1-num2) elif action == "m" : print(num1*num2) else: print(num1/num2)