コード例 #1
0
def get_create_data(context: CallbackContext):
    for item in main_data():
        position = db.items.find_one({'article': item['article']})
        if not position:
            position = {
                'article': item['article'],
                'name': item['name'],
                'price': item['price'],
                'date': str(date.today())
            }
            db.items.insert_one(position)
            text_1 = f"new! {item['name']} - {item['price']} руб."
            context.bot.send_message(chat_id=my_chat_id, text=text_1)
        else:
            new_price = item['price']
            if position['price'] == new_price:
                print('Такая есть!')
            else:
                print(f'Новая цена: {new_price}')
                db.items.update_one({'article': item['article']}, {
                    '$set': {
                        'price': item['price'],
                        'date': str(date.today())
                    }
                })
                dif_price = position['price'] - item['price']
                text_2 = f"Изменилась цена на {item['name']} - было {position['price']}, стало {item['price']} ({dif_price} руб.)"
                context.bot.send_message(chat_id=my_chat_id, text=text_2)
コード例 #2
0
def send_2tb(update: Update, context: CallbackContext):
    key = True
    for item in main_data():
        if '2Tb' in item['name']:
            key = False
            text = f"{item['name']} - {item['price']} руб."
            update.message.reply_text(text, reply_markup=get_keyboard())
    if key:
        update.message.reply_text('2Tb макбуков нет в наличии!',
                                  reply_markup=get_keyboard())
コード例 #3
0
ファイル: animo.py プロジェクト: MimansaSharma15/Animo
import streamlit as st
from help import health_analysis
from load_chatmodel import load
from data import main_data
from get_medical import get_links
import torch
from tensorflow.keras.preprocessing.sequence import pad_sequences

encoder_net, decoder_net = load()
data = main_data()
max, vocab_enc, vocab_dec = data.len_all()
tok_enc = data.tok_enc
tok_dec = data.tok_dec

st.title("Animo")
st.write("A Guide To Mental Heath")

html_temp1 = """
<div style="background-color:#000000  ;padding:10px; background:rgba(255,255,255,0.2); box-shadow: 0 5px 15px rgba(0,0,0,0.5)">
<h2 style="color:black;text-align:center;font-family: "Lucida Console", Courier, monospace;">“Anything that’s human is mentionable, and anything that is mentionable can be more manageable. When we can talk about our feelings, they become less overwhelming, less upsetting, and less scary.” Fred Rogers</h2>
</div>"""
st.markdown(html_temp1, unsafe_allow_html=True)
st.write("")
html_temp2 = """
<div style="background-color:#000000  ;padding:10px; background:rgba(255,255,255,0.2); box-shadow: 0 5px 15px rgba(0,0,0,0.5)">
<h2 style="color:black;text-align:center;font-family: "Lucida Console", Courier, monospace;">Animo is the latin translation of mind and noticing the sync where mental health is the well being of one's mind .We bring you a one stop guide to answer all your questions regarding mental health. We aim to provide and connect every individual with the vast expanse of mental health .Enter your queries in the space provided below and we'll be there at your service!!</h2>
</div>"""
st.markdown(html_temp2, unsafe_allow_html=True)

page_bg_img = '''
<style>
コード例 #4
0
def send_data(update: Update, context: CallbackContext):
    for item in main_data():
        text = f"{item['name']} - {item['price']} руб."
        update.message.reply_text(text, reply_markup=get_keyboard())