cursor.execute(f'''INSERT INTO {table_name}(value)
VALUES(?);''',(text,))
add_text('value')
cursor.execute(f'''INSERT INTO {table_name}(value1, value2, value3)
VALUES(?);''', text)
add_text(('value', 'second', third'))
lst = [1, 2, 1-2**64, 2**64]
lst = ["1", "2", "1-2**64", "2**64"]
pairs = [(x, eval(x)) for x in lst]
min_pair = min(pairs, key=lambda x: x[1])
print(min_pair[0])
Authorization: BOT <token>
query = f'''insert into adress_book(Имя,Фамилия,Номер_телефона,Адресс_электронной_почты)
values(%s,%s,%s,%s),
({new_contact.n_contact(information)[1]},{new_contact.n_contact(information)[0]},{new_contact.n_contact(information)[2]},{new_contact.n_contact(information)[3]})'''
run_sql_insert.run_sql_insert(query)
query = f'''insert into adress_book(Имя,Фамилия,Номер_телефона,Адресс_электронной_почты)
values(%s,%s,%s,%s)'''
run_sql_insert.run_sql_insert(query, new_contact)
# ...
cur.execute(sql_ins, args)
args
- кортеж из аргументов. NoEscape
.VerticalSpace("-1em")
что-то типа NoEscape("vspace=-1em")
The tag format is {python tag}-{abi tag}-{platform tag}
python tag
‘py27’, ‘cp33’
abi tag
‘cp32dmu’, ‘none’
platform tag
‘linux_x86_64’, ‘any’
encrypted_password_file = open('password_database.txt', 'r') # viewing the password database
password_database
with open('password_database.txt', 'rt') as encrypted_password_file:
# код
Я делаю def min():
Что будет после двоеточия? Какая логика?
Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side.