Esempio n. 1
0
def main():
    while True:
        if voice.detect_wake_up_word():
            input_text = voice.get_text_from_voice()
            print(input_text)  #voice 출력 문자열
            if input_text.find("날씨") != -1:  #날씨 문자열이 있을경우
                weather.main()
            elif input_text.find("냉장고") != -1:  #냉장고 문자열이 있을경우
                food_recognize.main()
            else:
                result_answer = voice.query_by_text(input_text)
                voice.speech(result_answer)  #다시 말씀해 주세요
Esempio n. 2
0
async def send_alert():
    while True:
        await client.wait_until_ready()
        channel = discord.utils.get(client.guilds[0].channels, name="general")
        msg = get_weather.main(alert=True)
        if msg is not None:
            await channel.send(msg)
        await asyncio.sleep(3600)
Esempio n. 3
0
def main():
    print('')
    f = Figlet(font='slant')
    print(f.renderText('Weather App'))
    print('                  Powered by openweathermap.org             ')

    c = input(
        'For login press L and for sign up press S to use the Weather App')
    if (c == 'L'):
        lid = input('Please provide user id')
        lpass = input('enter password')
        fileob = open('user.txt', 'r')
        res = eval(fileob.read())
        if lid not in res.keys():
            print('Incorrect username or password make sure you are signed up')
        elif (res[lid] == lpass):
            get_weather.main()
        else:
            print('Incorrect username or password make sure you are signed up')
    elif (c == 'S'):
        uid = input('Please provide user id')
        passw = input('Please provide Password')
        copass = input('Confirm Password')
        if (passw == copass):
            fileob = open('user.txt', 'r')
            res = eval(fileob.read())
            fileob.close()
            if uid in res.keys():
                print('user already exists')
                exit()
            res[uid] = passw
            fileob = open('user.txt', 'w')
            fileob.write(pprint.pformat(res))
            fileob.close()
            print('Signed up sucessfully')
    else:
        print(
            'Please select L for login or S for sign up to use the Weather App'
        )
Esempio n. 4
0
def main():
    Aberdeen = [57.25, -2.40, 57.00, -2.00]
    Aberdeenshire = [57.75, -4.00, 56.74, -1.70]
    WesternEurope = [60, -10, 40, 20] 
    box = WesternEurope
    strbox = (str(box)[1:-1]).replace(" ", "")
    our_list = get_data(strbox)
    # our_list is a list of dictionaries

    tidy_list = tidy_values(our_list)
    # tidy_list is a list of dictionaries that is easier to work with.

    weather_data = get_weather.main(box)

    # pp = pprint.PrettyPrinter(indent=1)
    # pp.pprint (tidy_list)
    # pp.pprint (weather_data)
    test_values(tidy_list, weather_data)

    return ()
Esempio n. 5
0
async def weather(ctx):
    await ctx.send(get_weather.main())