inline;filename="unnamed.jpg"
import requests
response = requests.get("https://lh4.ggpht.com/HSXdsQpFEOTgh0QywV4NzNJIPADnWnkCVOsMmQkIgG9K08pQcwpNiWlu3Ls73mzYMTM")
filename = response.headers["Content-Disposition"].split(";")[1].split("=")[1].strip('"') #вместо этого можно сгенерить случайное имя
file = open(filename, "wb")
file.write(response.content)
file.close()
SELECT EXISTS(SELECT * FROM authors where id = ?) -- Вернёт true, если какие-то записи по запросу находятся
import pythoncom
import os
# pythoncom.CoInitialize() # remove the '#' at the beginning of the line if running in a thread.
desktop = r'C:\Users\Public\Desktop' # path to where you want to put the .lnk
path = os.path.join(desktop, 'NameOfShortcut.lnk')
target = r'C:\path\to\target\file.exe'
icon = r'C:\path\to\icon\resource.ico' # not needed, but nice
shell = win32com.client.Dispatch("WScript.Shell")
shortcut = shell.CreateShortCut(path)
shortcut.Targetpath = target
shortcut.IconLocation = icon
shortcut.WindowStyle = 7 # 7 - Minimized, 3 - Maximized, 1 - Normal
shortcut.save()
from swinlnk.swinlnk import SWinLnk
swl = SWinLnk()
swl.create_lnk('W:\Foo\Bar', '/mnt/win_share/playground/Bar_winlink.lnk')
bot.send_photo(message.chat.id, get("https://im0-tub-ru.yandex.net/i?id=ad7b5dc2baef00695b93f71305f81888-l&n=13").content, reply_markup=main4())
bot.send_message(message.chat.id, "Татьяна, 22 года.", reply_markup = markup)
<a href="тут ссылка на картинку">‍</a>
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Ie()
driver.get("https://scdm.corp.vha.com")
alert = driver.switch_to_alert()
alert.authenticate("username","password")
time.sleep(20)
driver.close()
driver.find_element_by_id("ext-gen956").click()
driver.find_element_by_xpath("//*[@id="ext-gen956"]").click()
driver.find_element_by_link_text('Открыть в окне').click()
driver.switch_to.frame(driver.find_element_by_css_selector("iframe")) # тут селектор на нужный iframe