def getAccess(user_id):
with sqlite3.connect('users.db') as conn:
cursor = conn.cursor()
cursor.execute('SELECT user_group_id FROM users WHERE user_id=?',(user_id,))
result = cursor.fetchall()
return result
@bot.message_handler(commands=['auth'])
def Authorization(message):
access = getAccess(message.chat.id)
if access:
for acc in access:
if acc == 1:
bot.send_message(message.chat.id,'Привет Admin!')
else:
bot.send_message(message.chat.id,'Привет User!')
else:
bot.send_message(message.chat.id,'Вы не зарегистрированны в системе!')
tkinter exit event
elif message.text == 'Случайная песня':
files = os.listdir('songs1')
list = []
for x in files:
list.append(x)
song = random.choice(list)
bot.send_audio(message.chat.id, song)
elif message.text == 'Случайная песня':
song = random.choice([x for x in os.listdir('songs1')])
bot.send_audio(message.chat.id, song)
import cv2
import pyautogui
import numpy as np
small_image = cv2.imread('mask.png')
image = pyautogui.screenshot()
image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
result = cv2.matchTemplate(small_image, image, cv2.TM_CCOEFF)
_,_,_,xy = cv2.minMaxLoc(result)
MPx,MPy = xy
trows,tcols = small_image.shape[:2]
cropped_image = image[MPy:MPy+trows, MPx:MPx+tcols]
cv2.imwrite("CroppedImage.png", cropped_image)
aa = input()
bb = input()
a = complex(int(aa.split(' ')[0]), int(aa.split(' ')[1]))
b = complex(int(bb.split(' ')[0]), int(bb.split(' ')[1]))
s1 = (a+b)
s2 = (a-b)
s3 = (a*b)
print(a,' + ',b,' = ', s1)
print(a,' - ',b,' = ', s2)
print(a,' * ',b,' = ', s3)
let form = document.querySelector('.form'),
formRequired = document.querySelectorAll('.required');
form.onsubmit = function () {
if(document.querySelectorAll('.form-error')){
for(let x of document.querySelectorAll('.form-error')){
x.remove();
}
}
formRequired.forEach(function (input) {
if (input.value === '') {
input.classList.add('error');
var error = document.createElement('p');
error.innerHTML = 'Поле является обязательным';
error.classList.add('form-error');
input.after(error);
} else {
input.classList.remove('error');
}
})
return false;
}
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installati...
You do not need to install all supported external libraries to use Pillow’s basic features. Zlib and libjpeg are required by default.
mount -o remount, rw /
passwd pi
sync
exec /sbin/init
sudo poweroff