import xml.etree.ElementTree as ET
import collections
value = {}
root = ET.parse('xml_data.xml').getroot()
for type_tag in root.findall('objects/object'):
value[type_tag.attrib['name']] = type_tag.find('value').text
print(value)
sortedvalue = collections.OrderedDict(sorted(value.items()))
print(sortedvalue)
sortedvaluelist = []
for k, v in sortedvalue.items():
sortedvaluelist.append(v)
print(sortedvaluelist)
INSERT INTO newtablename
(SELECT id, objectid, lastname, firstname, middlename, position, status, personnelnumber, organization_id
FROM tablename AS t1
WHERE t1.objectid = (SELECT max( t2.objectid ) FROM tablename AS t2 WHERE t1.personnelnumber = t2.personnelnumber)
GROUP BY personnelnumber, id, objectid, lastname, firstname, middlename, position, status, organization_id)
def send_echo(message):
phone = message.text()
answer = "На бомбер поставлен " + message.text + "телефон" + "\n"
l = ['2110', '760', '10558', '2120', '(439)', '(370)', '2330', '(0)', '2340', '159', '65', '2350', '(98)', '(7)', '2410', '(0)', '(616)', '2400', '382', '9630']
for x in l:
if x.isnumeric():
if int(x) > 2000 and int(x) < 3000:
print(x)