Monday, January 31, 2022

Python Happy Birthday Program


import turtle
from random import randint, choice
width = 700
height = 500
S = turtle.Screen()
S.setup(width,height)
S.bgcolor('black')
S.title("Fireworks")
colors =['red','green','yellow','gold','pink','cyan','white','orange',
         'violet','coral']
class Fireworks:
    def __init__(self,radius):
        self.T = turtle.Pen()
        self.T.speed(0)
        self.T.color(choice(colors))
        self.T.hideturtle()
        self.T.up()
        self.T.setposition(randint(-250,250),randint(0,200))
        self.T.down()
        self.radius = radius

    def update(self):
        self.T.forward(self.radius)
        self.T.backward(self.radius)
        self.T.left(10)

    def clean(self):
        self.T.clear()
        self.T.color(choice(colors))
        self.T.up()
        self.T.setposition(randint(-250,250),randint(0,200))
        self.T.down()        
T1 = Fireworks(randint(10,100))
T2 = Fireworks(randint(10,100))
T3 = Fireworks(randint(10,100))
T4 = Fireworks(randint(10,100))
T5 = Fireworks(randint(10,100))
T = turtle.Pen()
T.sety(-150)
T.color('gold')
T.write('Happy Birthday To you',align='center',font=(None,50))
T.hideturtle()

while True:
       
    for i in range(36):
        T1.update()
        T2.update()
        T3.update()
        T4.update()        
        T5.update()
       
    T1.clean()
    T2.clean()
    T3.clean()
    T4.clean()  
    T5.clean()

turtle.mainloop()

Monday, April 13, 2020

how to install the pycharm IDE in 32 bit window

hi, the friend we mostly still use the 32-bit operating system .but as the latest software are   update as the requirements change.


  • Today we mostly download the latest version of pycharm "IDE" and we don't install the latest version in his window its reason we  its doesn't support  fulfill the software requirements 
  •  if we tried to install the pycharm latest version in 32 bit it shows 
      the error 

  • I install the first latest version it shows the error 

  •     now I fix this error 



Monday, April 6, 2020

How to get the htmlcontent of any website in readable form

How to get the HTML content of any website in a readable form

we can read the HTML content of any website.

we use two modules the first module is request and bs4 module
we use request module for get the HTML code of website and bs4 module use for arranging the 
unreadable HTML code in readable form 
request .get is used for get the HTML code 

source code:

import requests
from bs4 import BeautifulSoup
html_code=requests.get("URL")
#this get the code of website
print(html_code.text)
#This print the html code but we cannot read this code
# then we use bs4 module
# lets see the doc of bs4 module
soup = BeautifulSoup(html_code, 'html.parser')
soup_my=soup.prettify()
print(soup_my)
# lets see it print the html code in readable form 


Thursday, April 2, 2020

How to display the notification on the desktop by using plyer module

How to display the notification on the desktop by using plyer module

use player module

we display the notification on the screen 
for this purpose, we use pyton build-in module name plyer 
 cmd :pip install plyer

1: we creat a function it take two argument fist titlle of notification and second message of notifcation
2:notification.notify(title=''message=''app_name=''app_icon=''timeout=10ticker=''toast=False)


source:

from plyer import notification
def notify_me(tittle_my,messsage_my):
    notification.notify(
title=tittle_my, 
message=messsage_my,  
app_icon=None
timeout=10)

#now we execute it 
def notify_me('Alert','subscribe my youtube channel ')


how to fix pip not installed

mostly when we install the python in window int show the error
it can fix by the following steps

1:first open the computer property and then select the "Advanced system setting"

2: second the select the" environment variable:

and click on the "new"

 and then search the python .after open the python folder and copy the path all are shown in the images 








I hope it will help you

Saturday, March 28, 2020

How to perform automatic task by using python coding

How to perform automatic task by using python coding


PyAutoGUI 

in python, we use pyautogui module to perform automatic work

1: first we install module "pip3 install PyAutoGUI"for Linux user
2:if your window user then you type"pip install PyAutoGUI"

3:secod we find the screen cursor position  with
           currentMouseX, currentMouseY = pyautogui.position() # Get the XY position of the mouse.

4: for moving the cursor
pyautogui.moveTo(100, 150) # Move the mouse to XY coordinates
5: for click perform tast
pyautogui.click()          # Click the mouse.

source code:


import pyautogui as py,time
import webbrowser
time.sleep(5)

for i in range(20):
    time.sleep(12)
    #print(py.position())
    py.click(352 ,55)
    py.typewrite(" Adrees umer")
    time.sleep(7)
    py.typewrite(["enter"])

How to creat a live pentration tool for port scanning and ip finding using pyton programming

Making Your Port Scanner


port scanning is a method in which we can assess which of ports is open and which is the ports is closed
A port scanner allow you to look at the hosts and services that are attached to them. 

source code:

import socket
from datetime import datetime
target=input("Enter the target:")
print("_*"*60)
ip=socket.gethostbyname(target)
print(ip)
t1=datetime.now()
    
for port in range(1,500):
        
    sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    result=sock.connect_ex((ip,port))
    if result==0:
        
        print(f"port open:{port}")
    
    sock.close()
t2=datetime.now()
print(f"time{t2-t1}")
       
    
--------------------------------------------------------------------------------------------------------


Python Happy Birthday Program

import turtle from random import randint , choice width = 700 height = 500 S = turtle . Screen () S . setup ( width , height ) S . bg...