AK Python
1.85K subscribers
39 photos
2 videos
11 files
236 links
Join here to unlock your programming ability
Download Telegram
AK Python
https://docs.python.org/3.9/whatsnew/3.9.html
Python 3.9 released ( Official documentation )
Check out the new video guys
import requests
from bs4 import BeautifulSoup

headers={
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
}

response=requests.get("Paste your product link",headers=headers)
soup=BeautifulSoup(response.content,'html.parser')

def check_price():
title=soup.find(id="productTitle").get_text()
price=soup.find(id="priceblock_ourprice").get_text().strip()
print("Product name & specs : ",title.strip())
print("Product cost:",price)

check_price()
Code for Amazon price tracker
Share & Support ❤️
#YKYG
Stack uses
Anonymous Quiz
75%
LIFO
25%
FIFO
url shortner.gif
13 MB
Url shortner project using python ( Next video👆) Stay tuned❤️
#YKYG
Which one is the first fully supported 64-bit operating system?
Anonymous Quiz
22%
Windows vista
32%
Linux
15%
Mac
31%
Windows XP
New video : Url shortner project
from tkinter import *
import tkinter.ttk as ttk
from ttkthemes import ThemedTk
from tkinter import messagebox
import pyshorteners
import webbrowser


def logic():
s=pyshorteners.Shortener()
a=s.tinyurl.short("www.google.com")
messagebox.showinfo("This is your URL",a)

def callback():
url="www.google.com"
webbrowser.open_new(url)

top=ThemedTk(theme="scidgrey")
top.title("AK url shortner")
top.geometry("500x500")
filename=PhotoImage(file="A:\Edits\Link.png")
background_label=Label(top,image=filename)
background_label.place(x=0,y=0,relwidth=1,relheight=1)

b1=ttk.Button(top,text="Click to the open the Link",command=callback).pack()
b2=ttk.Button(top,text="Click to shorten the Url",command=logic).pack()

top.mainloop()
Code for Url shortener project ( Share & support ❤️ )
What is your level in Python?
Anonymous Poll
72%
Beginner
24%
Intermediate
4%
Pro
New video out now !
#YKYG

How many layers are present in OSI model?
Anonymous Quiz
12%
5
27%
6
12%
8
49%
7
New video check out..!
import numpy as np
import pandas as pd
import wordcloud


import os
print(os.listdir('A:\data'))

data = pd.read_csv('A:\data\spamdata.csv',encoding = 'latin-1')
data.shape
data.head()

#Dropping the unused columns
data = data.drop(['Unnamed: 2', 'Unnamed: 3', 'Unnamed: 4'], axis = 1)

# rename the columns

data = data.rename(columns = {'v1': 'Type', 'v2': 'Messages'})

data.columns

#Print Spam messages in messages

df = pd.DataFrame(data)
Spamfilter = df.loc[df['Type'] == 'spam']
print (Spamfilter)

#Print ham messages in Messages

df = pd.DataFrame(data)
hamfilter = df.loc[df['Type'] == 'ham']
print (hamfilter)

#Print the most common number of words used in all Messages

from wordcloud import WordCloud
import matplotlib.pyplot as plt

wordcloud = WordCloud(background_color = 'White', width = 1000, height = 1000, max_words = 50).generate(str(data['Messages']))

plt.rcParams['figure.figsize'] = (10, 10)
plt.title('Most Common words in the dataset', fontsize = 20)
plt.axis('off')
plt.imshow(wordcloud)

#Print the most number of words used in spam messages

from wordcloud import WordCloud

wordcloud = WordCloud(background_color = 'white', width = 1000, height = 1000, max_words = 50).generate(str([Spamfilter]))

plt.rcParams['figure.figsize'] = (10, 10)
plt.title('Most Common words in spam', fontsize = 20)
plt.axis('off')
plt.imshow(wordcloud)

#Print most number of words used in ham messages


from wordcloud import WordCloud

wordcloud = WordCloud(background_color = 'white', width = 1000, height = 1000, max_words = 50).generate(str([hamfilter]))

plt.rcParams['figure.figsize'] = (10, 10)
plt.title('Most Common words in ham', fontsize = 20)
plt.axis('off')
plt.imshow(wordcloud)
First part of the code ( Spam sms prediction Machine learning project )👆