-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeed.py
More file actions
36 lines (27 loc) · 1.43 KB
/
feed.py
File metadata and controls
36 lines (27 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import pendulum
from tkinter import *
app = Tk()
total_required = 960 # total mls required over 24 hours
ftf_input_hour = int(input("What HOUR do you want the first feed to be?"))
ftf_input_minute = int(input("What MINUTE do you want the first feed to be?"))
first_time_feed = pendulum.time(ftf_input_hour,ftf_input_minute)
ltf_input_hour = int(input("What HOUR do you want the last feed to be?"))
ltf_input_min = int(input("What MINUTE do you want the last feed to be?"))
last_feed_time = pendulum.time(ltf_input_hour,ltf_input_min)
feed_window = last_feed_time - first_time_feed
feed_window_string = str(feed_window)
try:
real_split = int(feed_window_string.replace("hours", "").replace(" ",""))
except:
real_split = feed_window_string.replace("hours ", ".").replace("minutes","").replace(" ", "")
print(real_split)
print(f"You have a {feed_window_string} feed window")
amount_of_feeds = int(input("How many total feeds do you want to do in the window?"))
amount_per_feed = round(total_required / amount_of_feeds, 0)
feed_time_split = float(real_split) / (amount_of_feeds -1)
x = 0
for i in range(amount_of_feeds):
if i % 2 !=0:
print(f"Your #{i +1} feed is at {first_time_feed.add(hours=round(x,2))} with a max of {amount_per_feed}mls. Otto is due for a longer nap after this feed")
else: print(f"Your #{i +1} feed is at {first_time_feed.add(hours=round(x,2))} with a max of {amount_per_feed}mls")
x += feed_time_split