Posts

Showing posts from June, 2021

MUSIC FEST 2

Image
  Billie Eilish Marshmello Selena Gomez The link for MUSIC FEST 1 MUSIC FEST 1

MUSIC FEST

Image
  Taylor Swift Ed Sheeran Justin Bieber

Geolocation in HTML ..

Image
 An HTML script that uses your longitude and latitude to find your location in Google Maps by Google Maps API key ..  The source code .. < !DOCTYPE html > < html > < head > < title > Geolocation API < / title > < / head > < body > < h2 > Find Your Location in below Map < / h2 > < button onclick = "getlocation();" > Show Position < / button > < div id = "demo" style = "width: 600px; height: 400px; margin-left: 200px;" > < / div > < script src = "https://maps.google.com/maps/api/js?sensor=false" > < / script > < script type = "text/javascript" > function getlocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPos , showErr); } else { alert( "Sorry! your Browser does not support Geolocation API" ) } } // Showing Current Poistion on Google Map function showPos(position) { latt = position.coo

News application in Python ..

Image
 News feed application in Python .. .. by gnewsclient The source code : # import modules from tkinter import * from gnewsclient import gnewsclient          # pip install gnewsclient # defined funtions def news (): client = gnewsclient.NewsClient( language =lang.get() , location =loc.get() , topic =top.get() , max_results = 3 ) news_list = client.get_news() result_title.set(news_list[ 0 ][ "title" ] + " \n " + news_list[ 1 ][ "title" ] + " \n " + news_list[ 2 ][ "title" ]) # tkinter object master = Tk() master.title( "NEWS" ) # background set to grey master.configure( bg = 'light grey' ) # Variable Classes in tkinter result_title = StringVar() result_link = StringVar() # Creating label for each information # name using widget Label Label(master , text = "Choose language :" , bg = "light grey" ).grid( row = 0 , sticky =W) Label(master , text = "Choose Location :"

A calculator in Python ..

Image
  Building a simple calculator in Python.. ..without installing any libraries .. The source code .. from tkinter import * #tkinter-preinstalled root=Tk() root.title( 'calculator' ) e=Entry(root , width = 35 , borderwidth = 5 , ) e.grid( row = 0 , column = 0 , columnspan = 3 , padx = 10 , pady = 10 ) #no pack function when grid is there.. #defining the functions of the commands in our buttons def button_click (number): current=e.get() e.delete( 0 , END) e.insert( 0 , str (current) + str (number)) def button_clear (): e.delete( 0 , END) def button_add (): first_number=e.get() global f_num global math math= 'addition' f_num= int (first_number) e.delete( 0 , END) def button_equalto (): second_number=e.get() e.delete( 0 , END) if math == "addition" : e.insert( 0 , f_num + int (second_number)) if math == "subtraction" : e.insert( 0 , f_num - int (second_number)) if math == "mu

PACMAN in Python ..

Image
If you want to build a simple game in Python ,this project is for you . A very simple PACMAN game ... The source code for PACMAN .. from random import choice from turtle import * from freegames import floor , vector # pip install freegames state = { 'score' : 0 } path = Turtle( visible = False ) writer = Turtle( visible = False ) aim = vector( 5 , 0 ) pacman = vector(- 40 , - 80 ) ghosts = [ [vector(- 180 , 160 ) , vector( 5 , 0 )] , [vector(- 180 , - 160 ) , vector( 0 , 5 )] , [vector( 100 , 160 ) , vector( 0 , - 5 )] , [vector( 100 , - 160 ) , vector(- 5 , 0 )] , ] tiles = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1

Cartoonizer in Python

Image
 A Python script that converts a normal image into a cartoonified one .. The code .. My image  You can use any image you want .. import cv2 # pip install opencv-python class Cartoonizer: def __init__ ( self ): pass def render ( self , img_rgb): img_rgb = cv2.imread(img_rgb) img_rgb = cv2.resize(img_rgb , ( 1366 , 768 )) numDownSamples = 2 # number of downscaling steps numBilateralFilters = 50 # number of bilateral filtering steps # -- STEP 1 -- # downsample image using Gaussian pyramid img_color = img_rgb for _ in range (numDownSamples): img_color = cv2.pyrDown(img_color) #cv2.imshow("downcolor",img_color) #cv2.waitKey(0) # repeatedly apply small bilateral filter instead of applying # one large filter for _ in range (numBilateralFilters): img_color = cv2.bilateralFilter(img_color , 9 , 9 , 7 ) #cv2.imshow("bilateral filter",img_color) #cv2.waitKe

Petrol Price Tracker in India ...

 A simple Petrol price tracker in India using Python .. The code ... The website where we are going to scrape the in the information .. Petrol Price Today (25 June 2021), Petrol Rate in India - Goodreturns import requests                     pip install requests import pandas as pd                pip install pandas from bs4 import BeautifulSoup      pip install bs4 def getdata (url):          # function to get the data r = requests.get(url) return r.text htmldata = getdata( "https://www.goodreturns.in/petrol-price.html" )     # the link soup = BeautifulSoup(htmldata , 'html.parser' )     # initializing BeautifulSoup mydatastr = '' result = [] # formatting the data for table in soup.find_all( 'tr' ): mydatastr += table.get_text() mydatastr = mydatastr[ 1 :] itemlist = mydatastr.split( " \n\n " ) for item in itemlist[:- 5 ]: result.append(item.split( " \n " )) df = pd.DataFrame(result[:- 8 ]) print (df) And the output ..