cur.execute('SELECT * FROM tags_db WHERE Path=?', (path, ))
if cur.fetchone():
cur.execute('UPDATE tags_db SET Song_Title=?, Album_Title=?, Song_Artist=?, Album_Artist=?, Year_of_Publishing=?, Track_Number=?, Length=?, Bitrate=? WHERE Path=?', (song_title, album_title, song_artist, album_artist, year_of_publishing, track_number, length, bitrate, path))
else:
cur.execute('INSERT INTO tags_db VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)', song_tags)
a = 'Petr'
b = 'Alex'
c = 'Max'
print(a, b, c, sep= ',')
import json
with open("data_file.json", "r") as read_file:
data = json.load(read_file)
if event.to_me:
request = event.text
if request == 'привет':
write_message()
from selenium.common.exceptions import NoSuchElementException
while True:
try:
webdriver.find_element_by_xpath(xpath)
except NoSuchElementException:
return True
break
a = []
res = a
res.append({'id':'1', 'article':'name', 'url':'a.io', 'price':'1000'})
print(res)
vk_session = vk_api.VkApi(
token='токен группы')
vk = vk_session.get_api()
Alpha = vk.docs.getMessagesUploadServer(type='audio_message', peer_id='id моей страницы')
with open('MyMusic.ogg', 'rb') as file:
files = {
'file': file
}
file = requests.post(Alpha['upload_url'], files=files).json()['file']
audio_msg = vk.docs.save(file=file, title=time.time(), )
string = 'doc' + str(audio_msg['audio_message']['owner_id']) + '_' + str(
audio_msg['audio_message']['id'])
vk.messages.send(random_id=time.time(), peer_id=event, message='Держи', attachment=string)
DZlist = ['Геометрия', 'Русский' ......]
if message.text in DZlist:
bot.send_message(message.chat.id, "Запишите дз")
else:
pass