Fixed Hi/Low spacing

This commit is contained in:
Tiwesdaeg Twohands 2019-10-22 08:32:47 -05:00
parent 88d8db6a52
commit d2344161b3
1 changed files with 7 additions and 2 deletions

View File

@ -83,7 +83,9 @@ def rain_inch(m):
def spacer(s):
length = len(s)
space = 16 - length
if space == 1:
if space == 2:
s = s + " "
elif space == 1:
s = s + " "
else:
pass
@ -128,6 +130,9 @@ for i in f:
#tempc = fixer(round(high_cel, 2)) + "°C/" + str(low_cel) + "°C"
tempf = fixer(round(high_temp, 2)) + "°F/" + fixer(round(low_temp, 2)) + "°F"
tempc = fixer(round(high_cel, 2)) + "°C/" + fixer(round(low_cel, 2)) + "°C"
#print(spacer(tempc), "|")
#test = len(tempc)
#print(test)
rainm = fixer(round(rain_calc(rain), 2)) + "mm"
raini = fixer(round(rain_inch(rain_calc(rain)), 2)) + "in"
@ -135,4 +140,4 @@ raini = fixer(round(rain_inch(rain_calc(rain)), 2)) + "in"
print('║ Daily High/Low ║▒ ║ Rainfall ║▒')
print('║ ║▒ ║ ║▒')
print('{0} ║▒ ║ {1} ║▒'.format(spacer(tempf), spacer_rain(raini)))
print('{0} ║▒ ║ {1} ║▒'.format(tempc, spacer_rain(rainm)))
print('{0} ║▒ ║ {1} ║▒'.format(spacer(tempc), spacer_rain(rainm)))