https://pypi.org/project/python-chess/ [ official documentation link for python chess game that we posted yesterday ] Thanks for watching [ Keep support me to get 10k subscribers
PyPI
python-chess
A chess library with move generation, move validation, and support for common formats.
‼️ Next video is about [ TOP 5 IDE( Integrated Development Environment ) for python] Stay tuned & Subscribe for updates👍
‼️[ New video is about How to earn money as a python programmer ] @8:00pm { Like share & subscribe }
‼️New video about creating a GUI timer using python { without tkinter } @8:00 pm
import PySimpleGUI as sg
import time
# Basic timer in PSG
def Timer():
sg.theme('DarkAmber')
gui= [[sg.Text(size=(24, 10), font=('Bahnschrift ', 20),
justification='center', key='text')],
[sg.Button('Pause', key='-RUN-PAUSE-'),
sg.Button('Reset'),
sg.Exit(button_color=('white', 'firebrick4'))]]
window = sg.Window('AK Timer', gui,
no_titlebar=False, auto_size_buttons=True)
#logic started
i = 0
paused = False
start_time = int(round(time.time() * 100))
while True:
# This is the code that reads and updates your window
button, values = window.read(timeout=10)
window['text'].update('{:02d}:{:02d}.{:02d}'.format(
(i // 100) // 60, (i // 100) % 60, i % 100))
#conditions
if values is None or button == 'Exit':
break
if button == 'Reset':
i = 0
elif button == '-RUN-PAUSE-':
paused = not paused
window['-RUN-PAUSE-'].update('Run' if paused else 'Pause')
if not paused:
i += 1
window.close()
Timer()
import time
# Basic timer in PSG
def Timer():
sg.theme('DarkAmber')
gui= [[sg.Text(size=(24, 10), font=('Bahnschrift ', 20),
justification='center', key='text')],
[sg.Button('Pause', key='-RUN-PAUSE-'),
sg.Button('Reset'),
sg.Exit(button_color=('white', 'firebrick4'))]]
window = sg.Window('AK Timer', gui,
no_titlebar=False, auto_size_buttons=True)
#logic started
i = 0
paused = False
start_time = int(round(time.time() * 100))
while True:
# This is the code that reads and updates your window
button, values = window.read(timeout=10)
window['text'].update('{:02d}:{:02d}.{:02d}'.format(
(i // 100) // 60, (i // 100) % 60, i % 100))
#conditions
if values is None or button == 'Exit':
break
if button == 'Reset':
i = 0
elif button == '-RUN-PAUSE-':
paused = not paused
window['-RUN-PAUSE-'].update('Run' if paused else 'Pause')
if not paused:
i += 1
window.close()
Timer()
👍1
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()
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()
‼️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)
generator=wordlist.Generator('1234567890')
for each in generator.generate('1,10') #10 different permutations
print(each)
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
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