This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import re | |
| def get_saved_wifi_profiles(): | |
| result = subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output=True, text=True) | |
| profiles = re.findall(r"All User Profile\s*:\s(.*)", result.stdout) | |
| return [profile.strip() for profile in profiles] | |
| def get_wifi_details(profile_name): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import librosa | |
| import soundfile as sf | |
| # Usage: python pitch_shift.py input.wav output.wav semitones | |
| input_file = "output.mp3" | |
| output_file = "pitched.mp3" | |
| semitones = -8 # positive = higher pitch, negative = lower pitch | |
| # Load audio | |
| y, sr = librosa.load(input_file, sr=None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import threading | |
| from audioplayer import AudioPlayer | |
| import keyboard # <-- Install it if you don't have: pip install keyboard | |
| # Create AudioPlayer object | |
| player = AudioPlayer("newanthem.mp3") | |
| # Show file info | |
| print(f"Filename: {player.filename}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| from tinyface import FacePair, TinyFace | |
| # Load the input image | |
| input_img = cv2.imread("3.jpg") | |
| # Initialize TinyFace | |
| tinyface = TinyFace() | |
| # (Optional) Prepare models (only needed once; will download automatically) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from deepface import DeepFace | |
| import cv2 | |
| import os | |
| import numpy as np # Add numpy | |
| # Path to image | |
| image_path = "angry.jpg" | |
| # Verify if image exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import os | |
| def webcam_face_capture(folder_path): | |
| # Load Haar Cascade for face detection | |
| face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') | |
| # Open webcam | |
| cap = cv2.VideoCapture(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tkinter as tk | |
| from tkinter_webcam import webcam | |
| # Create the main window | |
| window = tk.Tk() | |
| window.title("Webcam Viewer") | |
| # Create the webcam box | |
| webcam_object = webcam.Box(window, width=450, height=450) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tkinter as tk | |
| from tkinter import filedialog | |
| import cv2 | |
| from PIL import Image, ImageTk | |
| CAMERA_INDEX = 2 # Change based on your camera | |
| recording = False | |
| out = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from googletrans import Translator, LANGUAGES | |
| translator = Translator() | |
| text_to_translate = "Hello" | |
| for lang_code, lang_name in LANGUAGES.items(): | |
| try: | |
| translated = translator.translate(text_to_translate, src='en', dest=lang_code) | |
| print(f"{lang_name.title()} ({lang_code}): {translated.text}") | |
| except Exception as e: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from translate import Translator | |
| # Sample text | |
| text_to_translate = "Good night" | |
| # List of supported language codes (as per the `translate` library) | |
| language_codes = [ | |
| "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh", "zh-TW", | |
| "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", | |
| "ht", "ha", "haw", "he", "hi", "hmn", "hu", "is", "ig", "id", "ga", "it", "ja", "jw", "kn", "kk", |
NewerOlder