Когда стоит задуматься о переходе на webhook?
# запуск изменения картинки
topImg = PhotoImage(file="new_img.png")
l.configure(image=topImg)
l.image = topImg
if var_info in key_info:
import requests
class SomeService:
def __init__(self, **my_params):
self.my_params = my_params
def some_action(self):
response = requests.get(SOMEURL, my_params)
return response.json()
import requests
import os
import urllib3
import csv
import sqlite3
source = r'https://rossvyaz.gov.ru/data/'
abc3 = 'ABC-3xx.csv'
abc4 = 'ABC-4xx.csv'
abc8 = 'ABC-8xx.csv'
def9 = 'DEF-9xx.csv'
path = os.getcwd() + '\\NP\\'
db = path + "np.db"
try:
os.mkdir(path)
except OSError:
pass
file_list = [abc3, abc4, abc8, def9]
table = "CREATE TABLE numbering_plan(prefix INT, begin INT, end INT, capacity INT, operator TEXT, region TEXT);"
with sqlite3.connect(db) as connection:
cursor = connection.cursor()
cursor.execute(table)
for file in file_list:
urllib3.disable_warnings()
r = requests.get(source + file, verify=False)
open(path + file, 'wb').write(r.content)
with open(path + file, 'r', encoding='utf-8') as f:
dr = csv.DictReader(f, delimiter=';', quoting=csv.QUOTE_NONE)
to_db = [(i['АВС/ DEF'], i['От'], i['До'], i['Емкость'], i['Оператор'], i['Регион']) for i in dr]
with sqlite3.connect(db) as connection:
cursor = connection.cursor()
cursor.executemany("INSERT INTO numbering_plan (prefix, begin, end, capacity, operator, region) "
"VALUES (?, ?, ?, ?, ?, ?);", to_db)
import sqlite3
import os
path = os.getcwd() + '\\NP\\'
db = path + "np.db"
num = 1
while num:
num = input('Введите номер в формате ABD/DEАххх ')
prefix = num[:3]
number = num[3:]
search_query = 'SELECT * FROM numbering_plan WHERE prefix=? AND ? BETWEEN begin AND end;'
with sqlite3.connect(db) as connection:
cursor = connection.cursor()
cursor.execute(search_query, (prefix, number))
result = cursor.fetchall()
print(result)
PhoneOperator:
code = CharField()
name =
region =
PhoneRange:
minval = BigIntegerField()
maxval = BigIntegerField()
operator = ForeignKey(PhoneOperator)
Тогда
my_operator = PhoneOperator.objects.filter(
code=my_number[0:3],
phonerange__minval__lte=my_number[3:],
phonerange__maxval__gte=my_number[3:]
)
prefix_code = '495'
number = '1234567'
for row in data_rows[prefix_code]:
range_start, range_end, range_size, range_owner, range_region = row
if number < range_start:
continue # переходим к следующему
if number <= range_end:
print (f"Found {range_owner}, {range_region}")
else:
print ("Not found")
break
a
содержится коллекция элементов с классом `classname` (массив), соответственно ваша функция должна выглядеть следующим образом:function change () {
let a = $('.classname') ;
a[0].style.fontSize = '50px' ;
}
это, если требуется только у первого заменить свойство, если таких элементов много, то перебрать их через метод `.each()` коллекции `a` (https://api.jquery.com/each/) aside {
white-space: nowrap;
}
aside {
display: flex;
width: 80%;
height: 110px;
margin: 10px 0px 30px 10%;
border: 1px ridge Grey;
border-radius: 15px;
overflow-x: scroll;
}
aside img {
height: 100px;
margin-top: 5px;
margin-left: 10px;
border-radius: 10px;
border: 1px solid DimGrey;
}