Esempio n. 1
0
def countSubMult():
    from datetime import datetime

    subMDT = datetime.now()

    print("AAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHH")
    addCount = input("How many days will be removed?: ")
    if addCount.isdigit():
        rf = open('data2.txt', 'r')
        rf.seek(0)
        char = rf.read(3)
        if char.isdigit():
            char = int(char)
            char -= int(addCount)
            rf.close()
            with open('data2.txt', 'w') as f:
                f.write(str(char))
            display_alt.setDisplay(char)
            with open('date_log.txt', 'a') as af:
                af.write("{}: Subtracted {} making {} \n".format(
                    subMDT, addCount, char))

            print("Removed {} day(s), it has now been {} day(s)".format(
                addCount, char))
        else:
            print("ERROR: Day count is not an integer")
    else:
        print("ERROR Argument is not an intiger")
Esempio n. 2
0
def reset():
    from datetime import datetime
    display_alt.setDisplay(0)
    resetDT = datetime.now()

    with open('data2.txt', 'w') as f:
        f.write('0')
    with open('date_log.txt', 'a') as af:
        af.write("{}: Reset to 0 \n".format(resetDT))

    print("set to 0")
Esempio n. 3
0
def counter():
    global char

    rf = open('data2.txt', 'r')
    rf.seek(0)
    char = str(rf.read(3))

    print(char)
    print("")
    if char.isdigit():
        #print(char)
        #print(type(char))
        char = int(char)
        #print(type(char))
        char += 1
        #print(char)

        rf.close()
        with open('data2.txt', 'w') as f:
            f.write(str(char))
        display_alt.setDisplay(char)
    else:
        print("ERROR: Day count is not an integer")
Esempio n. 4
0
def countAdd():
    from datetime import datetime

    addDT = datetime.now()

    print("AAAAAAHHHHHH")
    rf = open('data2.txt', 'r')
    rf.seek(0)
    char = rf.read(3)

    if char.isdigit():
        char = int(char)
        char += 1
        rf.close()
        with open('data2.txt', 'w') as f:
            f.write(str(char))
        display_alt.setDisplay(char)

        with open('date_log.txt', 'a') as af:
            af.write("{}: Added 1 making {} \n".format(addDT, char))

    else:
        print("ERROR: Day count is not an integer")
Esempio n. 5
0
def countSub():
    from datetime import datetime

    subDT = datetime.now()

    rf = open('data2.txt', 'r')
    rf.seek(0)
    char = rf.read(3)

    if char.isdigit():
        char = int(char)
        char -= 1
        rf.close()
        with open('data2.txt', 'w') as f:
            f.write(str(char))
        display_alt.setDisplay(char)

        with open('date_log.txt', 'a') as af:
            af.write("{}: Subtracted 1 making {} \n".format(subDT, char))

    else:
        print("ERROR: Day count is not an integer")

    print("Removed 1 day, it has now been {} day(s)".format(char))