url = 'https://app.mango-office.ru/vpbx/stats/request'
vpbx_api_key = 'ключ'
sign = 'подпись'
mango_json = {
"date_from": "1072915200",
"date_to": "1072997812",
"fields": "records, start, finish, from_extension, from_number, to_extension, to_number, disconnect_reason", "call_party": {"extension": "116", "request_id": "001"}
}
data = {
'key': vpbx_api_key,
'sign': sign,
'json': mango_json,
}
req = requests.post(url, json=data)
print(req)
import asyncio
async def factorial(name, number):
f = 1
for i in range(2, number + 1):
print(f"Task {name}: Compute factorial({i})...")
await asyncio.sleep(1)
f *= i
print(f"Task {name}: factorial({number}) = {f}")
async def main():
# Schedule three calls *concurrently*:
await asyncio.gather(
factorial("A", 2),
factorial("B", 3),
factorial("C", 4),
)
asyncio.run(main())
gather(*[func(param) for param in params])
import requests
url = 'https://www.cs.uky.edu/~keen/115/Haltermanpythonbook.pdf'
r = requests.get(url, stream = True)
with open("PythonBook.pdf", "wb") as Pypdf:
for chunk in r.iter_content(chunk_size = 1024):
if chunk:
Pypdf.write(chunk)
proc_img= img[y:y+h, x:x+w]