Posts

Showing posts from May, 2024

roll dice using python with GUI.

Image
Welcome to roll dice code This is rolling dice code you can copy code then run but make Shure   .py file and image are same path other vice you can set the path of image. # # copyright by pyprojectlab # import tkinter from PIL import Image, ImageTk import random root = tkinter.Tk() root.geometry( '400x400' ) root.title( 'Roll the Dice' ) l0 = tkinter.Label(root, text = "" ) l0.pack() l1 = tkinter.Label(root, text = "Dice Rolling Simulator" , fg = "white" , bg = "black" , font = "Helvetica 16 bold italic" ) l1.pack() # Check your images path is correct dice = [ 'die1.png' , 'die2.png' , 'die3.png' , '/die4.png' , 'die5.png' , 'die6.png' ] image1 = ImageTk.PhotoImage(Image.open(random.choice(dice))) label1 = tkinter.Label(root, image =image1) label1.image = image1 label1.pack( expand = True ) def rolling_dice (): image1 = Imag...

Welcome to word finder in paragraph using python.

                                        Welcome to word finder This code is word finder in paragraph which line which word. You can write/paste paragraph paragraph = """ write a paragraph """ words_to_check = input ( "I am a word searcher, give me words (separated by commas): " ).split( ',' ) words_to_check = [word.strip() for word in words_to_check] lines = paragraph.split( ' \n ' ) for i, line in enumerate (lines): if any (word in line for word in words_to_check): highlighted_line = line for word in words_to_check: highlighted_line = highlighted_line.replace(word, f"** { word } **" ) print ( f"Line { i + 1 } : { highlighted_line } " )

Memory puzzle game make using python.

           Welcome to Memory puzzle game This is a memory puzzle game make using python. firstly, you can download some module then try this game. import random import pygame import sys from pygame.locals import * Frame_Speed = 30 Window_Width = 640 Window_Height = 480 Speed_Reveal = 8 Box_Size = 40 Gap_Size = 10 Border_Width = 10 Border_Height = 7 assert (Border_Width * Border_Height) % 2 == 0 , 'Board needs to have an even number of boxes for pairs of matches.' X_margin = int ((Window_Width - (Border_Width * (Box_Size + Gap_Size))) / 2 ) Y_margin = int ((Window_Height - (Border_Height * (Box_Size + Gap_Size))) / 2 ) Gray = ( 100 , 100 , 100 ) Navyblue = ( 60 , 60 , 100 ) White = ( 255 , 255 , 255 ) Red = ( 255 , 0 , 0 ) Green = ( 0 , 255 , 0 ) Blue = ( 0 , 0 , 255 ) Yellow = ( 255 , 255 , 0 ) Orange = ( 255 , 128 , 0 ) Purple = ( 255 , 0 , 255 ) Cyan = ( 0 , 255 , 255 ) BackGround_color = Gray Light_BackGround_color = Navyblue Box_Color = Cyan HighLight_C...

Any phone number detail finder using python

          Welcome to phone detail finder This is a phone number detail finder using python.  It is detail provide only country name, service provider name, Time zone. import phonenumbers from phonenumbers import geocoder, carrier, timezone # Get user input for the phone number phone_number_input = input ( "Enter the phone number (include country code): " ) # Parse the phone number phone_number = phonenumbers.parse(phone_number_input) # Get country name country_name = geocoder.description_for_number(phone_number, "en" ) # Get carrier information service_provider = carrier.name_for_number(phone_number, "en" ) # Get time zone information time_zone = timezone.time_zones_for_number(phone_number) # Print all the details print ( f"Country: { country_name } " ) print ( f"Service Provider: { service_provider } " ) print ( f"Time Zone: { time_zone } " )

GUI Age Calculator using python

            Welcome to GUI Age Calculator This is GUI Age Calculator using python you can more modify to this calculator. import tkinter as tk from tkinter import ttk from datetime import date class App: def __init__ ( self ): self .master = tk.Tk() self .master.configure( bg = "lightblue" ) self .master.title( 'Age Calculator' ) self .master.attributes( '-fullscreen' , True ) self .statement = tk.Label( self .master) # Add close button self .close_button = tk.Button( self .master, text = "X" , bg = "red" , fg = "white" , font = "Helvetica 10 bold" , command = self .close) self .close_button.place( relx = 0.30 , rely = 0.050 , anchor = "ne" ) # Function to close the window def close ( self ): self .master.destroy() def run ( self ): # Label and Entry for Name self .l1 = tk.Label( text = "Name: " , f...

Any emoji name finder

           Welcome to emoji name finder This is emoji name finder you give any emoji and get name of the emoji. import demoji # Test string with emojis text_with_emojis = input ( "Paste your emoji : " ) # Find meanings of emojis meanings = demoji.findall(text_with_emojis) print (meanings)

color guessing game with GUI using python

     Welcome to color guessing game with GUI This is the simple color guessing game you can make more complex or hard this game and other is you can add also level to take more interest to user. import tkinter import random import tkinter.simpledialog # List of possible colours. colours = [ 'Red' , 'Blue' , 'Green' , 'Pink' , 'Black' , 'Yellow' , 'Orange' , 'White' , 'Purple' , 'Brown' ] score = 0 incorrect_guesses = 0 # Function to prompt the user for game duration. def getGameDuration (): duration = tkinter.simpledialog.askinteger( "Game Duration" , "Enter game duration in seconds:" ) return duration # Set the game duration by prompting the user. GAME_DURATION = getGameDuration() # The game time left, initially GAME_DURATION seconds. timeleft = GAME_DURATION # Function that will start the game. def startGame (event): if timeleft == GAME_DURATION: # Start ...

Make Email checker using python.

                 Welcome to email checker This is simple format email checker using python. print("\n ******** Welcome to Email checker. *********\n\n") while True:     email = input("Enter an email: ")  # name@gmail.com, name@gmail.in     k, j, d = 0, 0, 0     if len(email) >= 6:         if ('@' in email) and (email.count("@") == 1):             if email[0].isalpha():                 if (email[-3] == ".") ^ (email[-4] == "."):                     for i in email:                         if i == i.isspace():                             k = 1                         elif i.isalpha():...

Any youtube video keywords find using python.

      Welcome to youtube video keywords    find This is any youtube video keywords find using python. You import  requests , bs4. Make sure your internet speed is good then work only. import requests from bs4 import BeautifulSoup def get_youtube_keywords (url): response = requests.get(url) soup = BeautifulSoup(response.text, 'html.parser' ) meta_keywords_tag = soup.find( 'meta' , attrs ={ 'name' : 'keywords' }) if meta_keywords_tag: return meta_keywords_tag[ 'content' ].split( ',' ) else : return None youtube_url = input("Enter the youtube video link : ") keywords = get_youtube_keywords(youtube_url) if keywords: print ( "Keywords:" , keywords) else : print ( "Keywords not found." )

Make your own any youtube video downloader using python.

                Welcome to youtube video downloader  This is your own any youtube video downloader using python. You import pytube. Make sure your internet speed is good then work only. from pytube import YouTube link = input ( "Enter the YouTube video link: " ) youtube = YouTube(link) videos = youtube.streams.filter( file_extension = 'mp4' ).all() for i, video in enumerate (videos): print ( f" { i } : mime_type='video/mp4', res=' { video.resolution } '" ) print () strm = int ( input ( "Enter the index of the video you want to download: " )) file_save_path = input ( "Enter the file save path: " ) videos[strm].download(file_save_path) print ( "Successfully downloaded." )

Make your own notification on windows using python.

                   Welcome to notification on windows This is your own notification on windows using python. You import plyer, time. import time from plyer import notification def notify (title, message): notification.notify( title =title, message =message, app_icon = None , # If you have an icon, specify the path here timeout = 10 , # Notification will disappear after 10 seconds ) def wait_until (target_time): while True : current_time = time.strftime( "%H:%M" , time.localtime()) if current_time == target_time: break time.sleep( 1 ) if __name__ == "__main__" : target_time = input ( "Enter the time in HH:MM format (e.g., 14:28): " ) title = input ( "Enter the title for the notification: " ) message = input ( "Enter the message for the notification: " ) wait_until(target_time) notify(title, message)

Make your own typing speed calculator using python.

          Welcome to typing speed calculator    This is make your own   typing speed calculator using python.  You import random and numpy. from time import time import random as r import numpy as np def levenshtein_distance (s1, s2): if len (s1) < len (s2): return levenshtein_distance(s2, s1) if len (s2) == 0 : return len (s1) previous_row = range ( len (s2) + 1 ) for i, c1 in enumerate (s1): current_row = [i + 1 ] for j, c2 in enumerate (s2): insertions = previous_row[j + 1 ] + 1 deletions = current_row[j] + 1 substitutions = previous_row[j] + (c1 != c2) current_row.append( min (insertions, deletions, substitutions)) previous_row = current_row return previous_row[- 1 ] def mistake (paragraph, user): error = 0 total_chars = len (paragraph) for i in range ( min ( len (paragraph), len (user))): if paragraph[i] != u...

Make your own internet checker using python

                Welcome to make own internet checker This is your own internet checker using python.  You import tkinter  module. This program takes few minutes. So, please passions. import tkinter import speedtest from tkinter import * def speedcheck (): Sp = speedtest.Speedtest() Sp.get_servers() down = str ( round (Sp.download()/( 10 ** 6 ), 3 ))+ " Mbps" up = str ( round (Sp.upload()/( 10 ** 6 ), 3 ))+ " Mbps" lab_down_val.config( text =down) lab_up_val.config( text =up) sp = Tk() sp.title( " Internet Speed Test " ) sp.geometry( "500x700" ) sp.config( bg = "light green" ) lab = Label(sp, text = "Internet Speed Test" , font =( "Time New Roman" , 30 , "bold" ), bg = "light green" , fg = "red" ) lab.place( x = 60 , y = 40 , height = 50 , width = 380 ) lab_down = Label(sp, text = "Download Speed" , font =( "Time New Roman" , 30 , "bold...