AK Python
1.86K subscribers
39 photos
2 videos
11 files
236 links
Join here to unlock your programming ability
Download Telegram
New video out now check out..!
#YKYG: Best Photoeditor on your choice.
Anonymous Poll
67%
Photoshop
6%
Gimp
19%
PicsArt
8%
Others
from selenium import webdriver
import time
browser = webdriver.Chrome('/home/arun/Downloads/chromedriver')
browser.get('https://instagram.com/')
time.sleep(4) #/html/body/div[1]/section/main/article/div[2]/div[1]/div/form/div/div[1]/div/label/input
Username=browser.find_element_by_xpath("/html/body/div[1]/section/main/article/div[2]/div[1]/div/form/div/div[1]/div/label/input")
Username.send_keys("Username")
time.sleep(4)
password=browser.find_element_by_xpath("/html/body/div[1]/section/main/article/div[2]/div[1]/div/form/div/div[2]/div/label/input")
password.send_keys("Password")
password.submit()
time.sleep(5)
Notnow=browser.find_element_by_xpath("/html/body/div[1]/section/main/div/div/div/div/button")
Notnow.click() #/html/body/div[1]/section/main/div/div/div/div/button
time.sleep(3)
Noti=browser.find_element_by_xpath("/html/body/div[4]/div/div/div/div[3]/button[2]")
Noti.click()
time.sleep(7)

def firstpic():
time.sleep(5)
pic = browser.find_element_by_class_name("_9AhH0")
pic.click()
def comment():
time.sleep(5)
commentArea = browser.find_element_by_class_name('Ypffh')
commentArea.click()
time.sleep(5)
commentArea = browser.find_element_by_class_name('Ypffh')
commentArea.click()
commentArea.send_keys("Test command")
commentArea.submit()

firstpic()
comment()
Code for Instagram Comment AutomationπŸ‘†
Code for Normal to sketch πŸ‘‡
import cv2
image = cv2.imread("/home/arun/Pictures/png/tom test images.png")
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imwrite("/home/arun/Pictures/png/TomSketch(gray).png", gray_image)
inverted_image = 255 - gray_image
cv2.imwrite("/home/arun/Pictures/png/TomSketch(inverted).png", inverted_image)
blurred = cv2.GaussianBlur(inverted_image, (21, 21), 0)
cv2.imwrite("/home/arun/Pictures/png/TomSketch(blured).png", blurred)
inverted_blurred = 255 - blurred
pencil_sketch = cv2.divide(gray_image, inverted_blurred, scale=256.0)
cv2.imwrite("/home/arun/Pictures/png/TomSketch.png", pencil_sketch)
Hello guys ..! My article is published on geeksforgeeksπŸ‘
Kindly check out
⚠️New video Today πŸ‘
New video out now ..!
New video out now..!
import turtle as t
playerAscore=0
playerBscore=0

window=t.Screen()
window.title("Pong Game")
window.bgcolor("green")
window.setup(width=800,height=600)
window.tracer(0)

#creating left paddle
leftpaddle=t.Turtle()
leftpaddle.speed(0)
leftpaddle.shape("square")
leftpaddle.color("white")
leftpaddle.shapesize(stretch_wid=5,stretch_len=1)
leftpaddle.penup()
leftpaddle.goto(-350,0)

#creating right paddle
rightpaddle=t.Turtle()
rightpaddle.speed(0)
rightpaddle.shape("square")
rightpaddle.color("white")
rightpaddle.shapesize(stretch_wid=5,stretch_len=1)
rightpaddle.penup()
rightpaddle.goto(350,0)

#creating ball

ball=t.Turtle()
ball.speed(0)
ball.shape("circle")
ball.color("red")
ball.penup()
ball.goto(5,5)
ballxdirection=0.2
ballydirection=0.2

#creating pen for scorecard update

pen=t.Turtle()
pen.speed(0)
pen.color("red")
pen.penup()
pen.hideturtle()
pen.goto(0,260)
pen.write("score",align="center",font=('Arial',24,'normal'))



#moving the leftpaddle

def leftpaddleup():
y=leftpaddle.ycor()
y=y+90
leftpaddle.sety(y)


def leftpaddledown():
y=leftpaddle.ycor()
y=y-90
leftpaddle.sety(y)

#moving the right paddle

def rightpaddleup():
y=rightpaddle.ycor()
y=y+90
rightpaddle.sety(y)


def rightpaddledown():
y=rightpaddle.ycor()
y=y-90
rightpaddle.sety(y)

#Assign keys to play

window.listen()
window.onkeypress(leftpaddleup,'w')
window.onkeypress(leftpaddledown,'s')
window.onkeypress(rightpaddleup,'Up')
window.onkeypress(rightpaddledown,'Down')

while True:
window.update()

#moving the ball
ball.setx(ball.xcor()+ballxdirection)
ball.sety(ball.ycor()+ballydirection)

#settingup border
if ball.ycor()>290:
ball.sety(290)
ballydirection=ballydirection*-1
if ball.ycor()<-290:
ball.sety(-290)
ballydirection=ballydirection*-1

if ball.xcor()>390:
ball.goto(0,0)
ballxdirection=ballxdirection
playerAscore=playerAscore+1
pen.clear()
pen.write("player A:{} player B:{}".format(playerAscore,playerBscore),align='center',font=('Arial',24,'normal'))

if(ball.xcor())<-390:
ball.goto(0,0)
ballxdirection=ballxdirection*-1
playerBscore=playerBscore+1
pen.clear()
pen.write("player A:{} player B:{}".format(playerAscore,playerBscore),align='center',font=('Arial',24,'normal'))


#Handling the Collisions

if (ball.xcor()>340)and(ball.xcor()<350)and(
ball.ycor()<rightpaddle.ycor()+40 and ball.ycor()>rightpaddle.ycor()-40):
ball.setx(340)
ballxdirection=ballxdirection*-1

if (ball.xcor()<-340)and(ball.xcor()>-350)and(
ball.ycor()<leftpaddle.ycor()+40 and ball.ycor()>leftpaddle.ycor()-40):
ball.setx(-340)
ballxdirection=ballxdirection*-1
πŸ‘2❀1
Full code for Pong game πŸ‘†
New video on this weekπŸ‘