Beispiel #1
0
def rm_data():
    date = Input.get_date()
    if date in weather:
        del weather[date]
        Open_file.save_data(weather, Configs.get_type())            # save changes in file
        input('Press Enter to continue...')
    else:
        input('Day in diary not found. Press Enter to continue...')
Beispiel #2
0
def add_data():
    date = Input.get_date()
    temp = Input.get_temp()
    preasure = Input.get_preasure()
    humidity = Input.get_humidity()
    wspeed = Input.get_wspeed()
    wdirect = input('Enter wind direction (eg. SW or S): ')
    prec = input('Enter precipitations (eg. Rain or Snow): ')
    tmp = {date: [temp, preasure, humidity, wspeed, wdirect, prec]}
    weather.update(tmp)                                         # rewrite data that already exsist
    Open_file.save_data(weather, Configs.get_type())                                # save changes in file
    input('Press Enter to continue...')