/System/Library/Frameworks/Python.framework/Versions/2.7/bin
такое используется чтобы скрипт или программа запускалась с конкретной версией питона, но тут лучше использовать python environment, что позволит ставить нужные библиотеки для каждого проекта отдельно, почитать тут или тут. А ещё перейти на python3 пора бы уже. import telebot
from time import sleep
from threading import Thread
from random import choice
import string
admin_id = 534905 # your id
bot = telebot.TeleBot(TOKEN) # your token
@bot.message_handler(commands=['help'])
def helper(message):
bot.send_message(message.from_user.id, f'You are {message.from_user.username}, {message.from_user.first_name}'
f'with id = {message.from_user.id}')
def check_email():
while True:
bot.send_message(admin_id, 'Check e-mail')
mails = [choice(string.ascii_letters) for i in range(5)]
if mails:
for mail in mails:
bot.send_message(admin_id, mail)
sleep(60)
Thread(target=check_email, args=()).start()
if __name__ == '__main__':
try:
bot.polling(none_stop=True)
except Exception as e:
print(e)
rank = 'PLAYER'
rank_d = {'PLAYER': {'don': 'Игрок', 'tsvet': '0x4fffff'}, 'VIP': {'don': 'VIP', 'tsvet': '0x00ff00'}}
if rank_d.get(rank):
don, tsvet = rank_d[rank]['don'], rank_d[rank]['tsvet']
print(f' Роль - {don}, код цвета hex = {tsvet} and код цвета int = {int(tsvet, 16)}')
else:
don = "Не удалось определить"
tsvet = "0x00ffff"
print(don, tsvet)
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
Select priceForm from table;
If var1 < var2:
Sql запрос с условием 1
else:
Sql запрос с условием 2
select eid from <table_name>
where
key in ("patronymic", "place_award")
and
value = "Павлович";