AK Python
1.86K subscribers
39 photos
2 videos
11 files
236 links
Join here to unlock your programming ability
Download Telegram
Code for the previous video [ Like share comment & subscribe for more updates ]
‼️ Code for Calendar GUI using python
import PySimpleGUI as sg

sg.theme('DarKAmber')
layout = [[sg.CalendarButton('Click here to see the date', target='-IN4-', format='%m-%d', default_date_m_d_y=(1,None,2020), )],
[sg.Button('Date Popup'), sg.Exit()]]

window = sg.Window('AK calendar',layout,no_titlebar=False)

while True:
event, values = window.read()
print(event, values)
if event in (sg.WIN_CLOSED, 'Exit'):
break
elif event == 'Date Popup':
sg.popup('You chose:', sg.popup_get_date())
window.close()
Keep support and share our channel for more updates
‼️New video is about [ Dictionary attack explained in python ] Today Night @8:00 pm Subscribe for instant notification👍
import wordlist
generator=wordlist.Generator('1234567890')
for each in generator.generate('1,10') #10 different permutations
print(each)
‼️Code for previous video [ Subscribe & share ]
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline


dataset=pd.read_csv('A:\data\studentscores.csv')

dataset.shape
(25,2)

dataset.head()
dataset.describe()


dataset.plot(x='Hours',y='Scores',style="*")
plt.title('Student mark prediction')
plt.xlabel('Hours')
plt.ylabel('Percentage marks')
plt.show()

X=dataset.iloc[:, :-1].values
Y=dataset.iloc[:,1].values


from sklearn.model_selection import train_test_split
X_train,X_test,Y_train,Y_test=train_test_split(X,Y,test_size=0.2,random_state=0)

from sklearn.linear_model import LinearRegression
regressor=LinearRegression()
regressor.fit(X_train,Y_train)

print(regressor.intercept_)

print(regressor.coef_)

y_pred=regressor.predict(X_test)
df=pd.DataFrame({'Actual':Y_test,'Predicted':y_pred})
df
1
‼️code for previous video { Student mark prediction project } [ Like share comment and subscribe❤️
import pickle
var = input("Please enter the news text you want to verify: ")
print("You entered: " + str(var))


# function to run for prediction
def fakenews(var):
# retrieving the best model for prediction call
load_model = pickle.load(open('A:\data\model.sav', 'rb'))
prediction = load_model.predict([var])
prob = load_model.predict_proba([var])

return (print("The given statement is ",prediction[0]),
print("The truth probability score is ",prob[0][1]))


if name == 'main':
fakenews(var)
🤔3
Here is the code for Fake news predictor Using python [ Keep share & support for more updates❤️]
⚠️Kindly follow our Instagram account [ akpythonyt ] for interactions and more programming updates😊
[ subscribe & stay tuned ]
from colorthief import ColorThief

colorthief=ColorThief("Path of your image")

dominatcolor=colorthief.get_color(quality=1)
print(dominatcolor)

palette=colorthief.get_palette(color_count=6)
print(palette)
code for Color prediction👆
import PySimpleGUI as sg
import psutil
sg.theme('DarkAmber')

layout = [[sg.Text('CPU Meter')],
[sg.Text(size=(15,4 ), font=('Helvetica', 20),
justification='center', key='-text-')],
[sg.Exit(button_color=('white', 'firebrick4'),size=(9, 1))]]
window = sg.Window('AK CPU widget',
layout,
no_titlebar=False,
grab_anywhere=True, finalize=True)
interval = 10
while True:
event, values = window.read(timeout=interval)
if event in (sg.WIN_CLOSED, 'Exit'):
break
cpu_percent = psutil.cpu_percent(interval=1)
window['-text-'].update(f'CPU {cpu_percent:02.0f}%')
window.close()
⚠️code for CPU meter widget using python [ subscribe and support ]
This media is not supported in your browser
VIEW IN TELEGRAM
Today 8:00 PM [ Subscribe & share ]😊