[2024-10-12] Adding footer, minor fixes to Python
This commit is contained in:
parent
f1c63d0ecf
commit
7356b00de1
3 changed files with 37 additions and 25 deletions
|
@ -35,7 +35,6 @@ def cartesianToLatLong(x,y,z):
|
|||
|
||||
return lat, long
|
||||
|
||||
|
||||
def getPercentageLatLong(yearPercent,lat1,long1,lat2,long2):
|
||||
# http://www.geomidpoint.com/calculation.html
|
||||
x1, y1, z1 = latLongToCartesian(lat1,long1)
|
||||
|
@ -73,46 +72,46 @@ def abbeyRoad(yearPercent):
|
|||
# 3:27
|
||||
elif numSeconds <= 441+(3*60+27):
|
||||
return "Maxwell's Silver Hammer"
|
||||
#3:27
|
||||
# 3:27
|
||||
elif numSeconds <= 648+(3*60+27):
|
||||
return "Oh! Darling"
|
||||
#2:50
|
||||
# 2:50
|
||||
elif numSeconds <= 855+(2*60+50):
|
||||
return "Octopus's Garden"
|
||||
#7:47
|
||||
# 7:47
|
||||
elif numSeconds <= 1025+(7*60+47):
|
||||
return "I Want You (She's So Heavy)"
|
||||
#3:05
|
||||
# 3:05
|
||||
elif numSeconds <= 1492+(3*60+5):
|
||||
return "Here Comes The Sun"
|
||||
#2:45
|
||||
# 2:45
|
||||
elif numSeconds <= 1677+(2*60+45):
|
||||
return "Because"
|
||||
#4:02
|
||||
# 4:02
|
||||
elif numSeconds <= 1842+(4*60+2):
|
||||
return "You Never Give Me Your Money"
|
||||
#2:26
|
||||
# 2:26
|
||||
elif numSeconds <= 2084+(2*60+26):
|
||||
return "Sun King"
|
||||
#1:06
|
||||
# 1:06
|
||||
elif numSeconds <= 2230+(1*60+6):
|
||||
return "Mean Mr. Mustard"
|
||||
#1:12
|
||||
# 1:12
|
||||
elif numSeconds <= 2296+(1*60+12):
|
||||
return "Polythene Pam"
|
||||
#1:58
|
||||
# 1:58
|
||||
elif numSeconds <= 2368+(1*60+58):
|
||||
return "She Came In Through The Bathroom Window"
|
||||
#1:31
|
||||
# 1:31
|
||||
elif numSeconds <= 2486+(1*60+31):
|
||||
return "Golden Slumbers"
|
||||
#1:36
|
||||
# 1:36
|
||||
elif numSeconds <= 2577+(1*60+36):
|
||||
return "Carry That Weight"
|
||||
#2:21
|
||||
# 2:21
|
||||
elif numSeconds <= 2673+(2*60+21):
|
||||
return "The End"
|
||||
#0:25
|
||||
# 0:25
|
||||
else:
|
||||
return "Her Majesty"
|
||||
|
||||
|
@ -127,7 +126,7 @@ def transatlanticFlight(yearPercent):
|
|||
long2 = -73.780968
|
||||
|
||||
lat, long = getPercentageLatLong(yearPercent,lat1,long1,lat2,long2)
|
||||
return lat, long
|
||||
return round(lat,2), round(long,2)
|
||||
|
||||
def getHomoSapiens(yearPercent):
|
||||
totalYears = 4.3e9
|
||||
|
@ -148,7 +147,7 @@ def getTemplate():
|
|||
yearPercent = delta/totalDays
|
||||
footballMinute = math.floor(yearPercent*90)
|
||||
workDay, workTime = workWeek(yearPercent)
|
||||
marathonMile = 26.2 - math.floor(yearPercent*26.2)
|
||||
marathonMile = round(26.2 - math.floor(yearPercent*26.2),2)
|
||||
abbeyRoadSong = abbeyRoad(yearPercent)
|
||||
hobbitChapter = "having an unexpected party"
|
||||
lat, long = transatlanticFlight(yearPercent)
|
||||
|
@ -156,9 +155,6 @@ def getTemplate():
|
|||
|
||||
return now.year, nowTime, nowDate, round(yearPercent*100,2), footballMinute, workDay, workTime, marathonMile, abbeyRoadSong, hobbitChapter, lat, long, homoSapiens
|
||||
|
||||
# Transatlantic flight
|
||||
# History of the earth
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
year, nowTime, nowDate, yearPercent, footballMinute, workDay, workTime, marathonMile, abbeyRoadSong, hobbitChapter, lat, long, homoSapiens = getTemplate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue