123.456.789
b = '{0:,}'.format(a).replace(',', ' ')
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import warnings
import locale
import json
import requests
warnings.filterwarnings("ignore")
locale.setlocale(locale.LC_ALL, '')
yandexkey = "dict.1.1.there_are_a_lot_of_numbers"
lang = "ru-en"
text = "бред"
uri = f"https://dictionary.yandex.net/api/v1/dicservice.json/lookup?key={yandexkey}&lang={lang}&text={text}"
outelem = len(json.loads(requests.post(uri).text))
r = requests.post(uri)
for x in range(0, outelem + 1):
print (eval(r.text)["def"][0]["tr"][x]["text"])
delirium
drivel
brad
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import requests
from requests.auth import HTTPDigestAuth
headers = {
'User-agent': 'Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-language': 'ru,en-US;q=0.7,en;q=0.3',
'Accept-encoding': 'gzip, deflate',
'Dnt': '1',
'Connection': 'keep-alive',
'Cache-Control' : "max-age=0",
'Cookie' : "_gauges_unique_month=1; _gauges_unique_year=1; _gauges_unique=1",
'Upgrade-insecure-requests': '1',
'X-DNS-Prefetch-Control': 'on',
'Cf-Visitor': '{"scheme":"https"}',
'X-Forwarded-Proto': 'https'
}
login = 'userid'
password = 't43dwd'
url = 'https://site.ru/adminpanel/index.php'
startp = requests.get(url, auth=HTTPDigestAuth(login, password), headers=headers).text
print (startp)
pip3.6 install --user PyUSB
import usb
busses = usb.busses()
for bus in busses:
devices = bus.devices
for dev in devices:
handle = dev.open()
print("Device:", dev.filename)
print(" VID: 0x{:04x}".format(dev.idVendor))
print(" PID: 0x{:04x}".format(dev.idProduct))
print(" Manufacturer: 0x{:x}".format(dev.iManufacturer), end='')
import ephem
obs = ephem.Observer()
sun = ephem.Sun()
obs.lat = lat
obs.long = lng
obs.date = datetime.datetime.today()
rise_time = obs.next_rising(sun)
...............и так далее
ModuleNotFoundError: No module named 'ephem'
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import pyautogui #грузим pyautogui
scri = pyautogui.size() #определим размер экрана
mous_pos = pyautogui.position() # определим позицию курсора
#pyautogui.moveTo(mous_pos[0]+100, mous_pos[1]+100, duration=1)
#Перемещение в вашем случае не обязательно - это пример
pyautogui.typewrite('\nСейчас я напечатаю десять символов в секунду!\n', interval=0.1)
print (scri, mous_pos[0], mous_pos[1]) # распечатаем позицию курсора мыши