SPECIFICATION Create a GUI app that displays the temperature differential from the baseline Celcius average from XXXXXXXXXXdegrees Celsius). The X-axis range is the range of years in the...

1 answer below ยป
SPECIFICATION
Create a GUI app that displays the temperature differential from the baseline Celcius average from 1960-1990 (0 degrees Celsius). The X-axis range is the range of years in the Temperature.html file. The Y-axis range is the range of the temperature in relation to the average.


Data Files
Temperature.html: Same file as used in lab0


DataBase.py
Convert the SQLite example functions to be class member functions, where the SQLite database is the data member. Store the Temperature data in your SQLite class object. Make the SQLite member functions as generic as possible to handle storing any type of data.


FrontEnd.py
Create a user interface using Tkinter that allows the user to plot:
* XY Plot
* Bar Chart
* Linear Regression


Graph.py
* Use MatPlotLib to create the selected graph or chart
* Design a Graph class that manages the MatPlotLib operations. See the MatPlotLib examples. For example write class member functions to draw a Plot, Bar, and Linear Regression.


BackEnd.py
* Use Graph.py to plot the requested plot selected from the front end.
* Reuse parts of lab0 as necessary




I'll attach the Lab0 file code as well.


































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































# Average temperature
# Relative to 1961-1990
# Celcius
YearMedianUpperLower
1850-0.373-0.339-0.425
1851-0.218-0.184-0.274
1852-0.228-0.196-0.28
1853-0.269-0.239-0.321
1854-0.248-0.218-0.301
1855-0.272-0.241-0.324
1856-0.358-0.327-0.413
1857-0.461-0.431-0.512
1858-0.467-0.435-0.521
1859-0.284-0.249-0.34
1860-0.343-0.31-0.405
1861-0.407-0.356-0.484
1862-0.524-0.471-0.597
1863-0.278-0.226-0.359
1864-0.494-0.448-0.564
1865-0.279-0.232-0.358
1866-0.251-0.197-0.338
1867-0.321-0.265-0.406
1868-0.238-0.185-0.326
1869-0.262-0.221-0.333
1870-0.276-0.239-0.34
1871-0.335-0.293-0.404
1872-0.227-0.187-0.29
1873-0.304-0.258-0.364
1874-0.368-0.325-0.435
1875-0.395-0.352-0.464
1876-0.384-0.335-0.453
1877-0.075-0.026-0.146
18780.0350.084-0.026
1879-0.23-0.189-0.291
1880-0.227-0.182-0.288
1881-0.2-0.157-0.259
1882-0.213-0.171-0.274
1883-0.296-0.251-0.35
1884-0.409-0.373-0.457
1885-0.389-0.354-0.444
1886-0.367-0.334-0.419
1887-0.418-0.382-0.476
1888-0.307-0.268-0.359
1889-0.171-0.129-0.235
1890-0.416-0.369-0.484
1891-0.33-0.276-0.408
1892-0.455-0.4-0.526
1893-0.473-0.416-0.547
1894-0.41-0.352-0.487
1895-0.39-0.335-0.46
1896-0.186-0.136-0.255
1897-0.206-0.153-0.273
1898-0.412-0.362-0.479
1899-0.289-0.231-0.355
1900-0.203-0.147-0.272
1901-0.259-0.208-0.326
1902-0.402-0.355-0.461
1903-0.479-0.431-0.543
1904-0.52-0.471-0.58
1905-0.377-0.326-0.438
1906-0.283-0.232-0.338
1907-0.465-0.423-0.523
1908-0.511-0.468-0.563
1909-0.522-0.476-0.576
1910-0.49-0.448-0.547
1911-0.544-0.498-0.595
1912-0.437-0.392-0.486
1913-0.424-0.381-0.471
1914-0.244-0.197-0.291
1915-0.141-0.085-0.202
1916-0.383-0.328-0.437
1917-0.468-0.413-0.525
1918-0.333-0.27-0.396
1919-0.275-0.217-0.327
1920-0.247-0.198-0.296
1921-0.187-0.149-0.237
1922-0.302-0.262-0.346
1923-0.276-0.237-0.323
1924-0.294-0.259-0.34
1925-0.215-0.178-0.265
1926-0.108-0.07-0.155
1927-0.21-0.177-0.253
1928-0.206-0.174-0.253
1929-0.35-0.32-0.394
1930-0.137-0.104-0.181
1931-0.087-0.055-0.133
1932-0.137-0.107-0.183
1933-0.273-0.24-0.32
1934-0.131-0.1-0.177
1935-0.178-0.15-0.221
1936-0.147-0.12-0.186
1937-0.0260.001-0.064
1938-0.0060.017-0.044
1939-0.052-0.029-0.088
19400.0140.045-0.018
19410.020.053-0.021
1942-0.0270.015-0.081
1943-0.0040.036-0.056
19440.1440.180.094
19450.0250.059-0.017
1946-0.071-0.042-0.113
1947-0.0380.001-0.098
1948-0.0390-0.101
1949-0.074-0.036-0.119
1950-0.173-0.135-0.216
1951-0.052-0.018-0.091
19520.0280.063-0.01
19530.0970.1320.06
1954-0.129-0.093-0.166
1955-0.19-0.16-0.222
1956-0.267-0.236-0.297
1957-0.0070.024-0.035
19580.0460.0750.02
19590.0170.043-0.008
1960-0.049-0.023-0.073
19610.0380.060.009
19620.0140.034-0.012
19630.0480.0740.022
1964-0.223-0.197-0.246
1965-0.14-0.113-0.163
1966-0.068-0.042-0.09
1967-0.074-0.052-0.093
1968-0.113-0.097-0.133
19690.0320.050.014
1970-0.027-0.009-0.048
1971-0.186-0.163-0.204
1972-0.065-0.04-0.08
19730.0620.0820.051
1974-0.214-0.197-0.227
1975-0.149-0.134-0.163
1976-0.241-0.227-0.255
19770.0470.0640.034
1978-0.062-0.044-0.077
19790.0570.0760.041
19800.0920.1070.077
19810.140.1530.125
19820.0110.03-0.011
19830.1940.2110.174
1984-0.0140.006-0.033
1985-0.03-0.013-0.048
19860.0450.0670.024
19870.1920.220.171
19880.1980.2210.175
19890.1180.1470.091
19900.2960.330.267
19910.2540.2890.22
19920.1050.1390.071
19930.1480.1860.112
19940.2080.2470.174
19950.3250.3610.289
19960.1830.2170.146
19970.390.4250.356
19980.5390.5780.5
19990.3060.3430.265
20000.2940.3380.259
20010.4410.4830.406
20020.4960.5380.463
20030.5050.5460.473
20040.4470.4830.413
20050.5450.5830.507
20060.5060.5440.468
20070.4910.5310.457
20080.3950.4320.355
20090.5060.5460.465
20100.560.6030.523
20110.4250.4660.393
20120.470.5090.437
20130.5140.5520.478
20140.5790.6160.545
20150.7630.8020.73
20160.7970.8350.762
20170.6770.7160.636
20180.5950.6340.558

Lab0/Co2.html # Total carbon emissions # (million metric tons of C) yearmonthdecimalaverageinterpolatedtrend#days 195911959.042315.62315.62315.70-1 195921959.125316.38316.38315.88-1 195931959.208316.71316.71315.62-1 195941959.292317.72317.72315.56-1 195951959.375318.29318.29315.50-1 195961959.458318.15318.15315.92-1 195971959.542316.54316.54315.66-1 195981959.625314.80314.80315.81-1 195991959.708313.84313.84316.55-1 1959101959.792313.26313.26316.19-1 1959111959.875314.80314.80316.78-1 1959121959.958315.58315.58316.52-1 196011960.042316.43316.43316.51-1 196021960.125316.97316.97316.47-1 196031960.208317.58317.58316.49-1 196041960.292319.02319.02316.86-1 196051960.375320.03320.03317.24-1 196061960.458319.59319.59317.36-1 196071960.542318.18318.18317.30-1 196081960.625315.91315.91316.92-1 196091960.708314.16314.16316.87-1 1960101960.792313.83313.83316.76-1 1960111960.875315.00315.00316.98-1 1960121960.958316.19316.19317.13-1 196111961.042316.93316.93317.03-1 196121961.125317.70317.70317.28-1 196131961.208318.54318.54317.47-1 196141961.292319.48319.48317.27-1 196151961.375320.58320.58317.70-1 196161961.458319.77319.77317.48-1 196171961.542318.57318.57317.70-1 196181961.625316.79316.79317.80-1 196191961.708314.80314.80317.49-1 1961101961.792315.38315.38318.35-1 1961111961.875316.10316.10318.13-1 1961121961.958317.01317.01317.94-1 196211962.042317.94317.94318.06-1 196221962.125318.56318.56318.11-1 196231962.208319.68319.68318.57-1 196241962.292320.63320.63318.45-1 196251962.375321.01321.01318.20-1 196261962.458320.55320.55318.27-1 196271962.542319.58319.58318.67-1 196281962.625317.40317.40318.48-1 196291962.708316.26316.26319.03-1 1962101962.792315.42315.42318.33-1 1962111962.875316.69316.69318.62-1 1962121962.958317.69317.69318.61-1 196311963.042318.74318.74318.91-1 196321963.125319.08319.08318.68-1 196331963.208319.86319.86318.69-1 196341963.292321.39321.39319.09-1 196351963.375322.25322.25319.39-1 196361963.458321.47321.47319.16-1 196371963.542319.74319.74318.77-1 196381963.625317.77317.77318.83-1 196391963.708316.21316.21319.06-1 1963101963.792315.99315.99319.00-1 1963111963.875317.12317.12319.10-1 1963121963.958318.31318.31319.25-1 196411964.042319.57319.57319.67-1 196421964.125-99.99320.07319.61-1 196431964.208-99.99320.73319.55-1 196441964.292-99.99321.77319.48-1 196451964.375322.25322.25319.42-1 196461964.458321.89321.89319.69-1 196471964.542320.44320.44319.58-1 196481964.625318.70318.70319.81-1 196491964.708316.70316.70319.56-1 1964101964.792316.79316.79319.78-1 1964111964.875317.79317.79319.72-1 1964121964.958318.71318.71319.59-1 196511965.042319.44319.44319.48-1 196521965.125320.44320.44319.97-1 196531965.208320.89320.89319.65-1 196541965.292322.13322.13319.80-1 196551965.375322.16322.16319.36-1 196561965.458321.87321.87319.65-1 196571965.542321.39321.39320.51-1 196581965.625318.81318.81319.93-1 196591965.708317.81317.81320.68-1 1965101965.792317.30317.30320.36-1 1965111965.875318.87318.87320.87-1 1965121965.958319.42319.42320.26-1 196611966.042320.62320.62320.63-1 196621966.125321.59321.59321.10-1 196631966.208322.39322.39321.16-1 196641966.292323.87323.87321.51-1 196651966.375324.01324.01321.18-1 196661966.458323.75323.75321.52-1 196671966.542322.39322.39321.49-1 196681966.625320.37320.37321.50-1 196691966.708318.64318.64321.54-1 1966101966.792318.10318.10321.18-1 1966111966.875319.79319.79321.84-1 1966121966.958321.08321.08321.95-1 196711967.042322.07322.07322.07-1 196721967.125322.50322.50321.94-1 196731967.208323.04323.04321.72-1 196741967.292324.42324.42322.05-1 196751967.375325.00325.00322.27-1 196761967.458324.09324.09321.94-1 196771967.542322.55322.55321.66-1 196781967.625320.92320.92322.04-1 196791967.708319.31319.31322.19-1 1967101967.792319.31319.31322.36-1 1967111967.875320.72320.72322.78-1 1967121967.958321.96321.96322.86-1 196811968.042322.57322.57322.55-1 196821968.125323.15323.15322.56-1 196831968.208323.89323.89322.59-1 196841968.292325.02325.02322.73-1 196851968.375325.57325.57322.87-1 196861968.458325.36325.36323.20-1 196871968.542324.14324.14323.25-1 196881968.625322.03322.03323.15-1 196891968.708320.41320.41323.31-1 1968101968.792320.25320.25323.32-1 1968111968.875321.31321.31323.32-1 1968121968.958322.84322.84323.69-1 196911969.042324.00324.00323.98-1 196921969.125324.42324.42323.89-1 196931969.208325.64325.64324.41-1 196941969.292326.66326.66324.35-1 196951969.375327.34327.34324.57-1 196961969.458326.76326.76324.63-1 196971969.542325.88325.88325.08-1 196981969.625323.67323.67324.80-1 196991969.708322.38322.38325.28-1 1969101969.792321.78321.78324.84-1 1969111969.875322.85322.85324.78-1 1969121969.958324.11324.11324.88-1 197011970.042325.03325.03325.04-1 197021970.125325.99325.99325.42-1 197031970.208326.87326.87325.69-1 197041970.292328.13328.13325.86-1 197051970.375328.07328.07325.27-1 197061970.458327.66327.66325.52-1 197071970.542326.35326.35325.51-1 197081970.625324.69324.69325.76-1 197091970.708323.10323.10325.93-1 1970101970.792323.16323.16326.15-1 1970111970.875323.98323.98325.96-1 1970121970.958325.13325.13326.06-1 197111971.042326.17326.17326.25-1 197121971.125326.68326.68326.10-1 197131971.208327.18327.18325.94-1 197141971.292327.78327.78325.47-1 197151971.375328.92328.92326.11-1 197161971.458328.57328.57326.40-1 197171971.542327.34327.34326.45-1 197181971.625325.46325.46326.49-1 197191971.708323.36323.36326.19-1 1971101971.792323.57323.57326.58-1 1971111971.875324.80324.80326.82-1 1971121971.958326.01326.01327.02-1 197211972.042326.77326.77326.85-1 197221972.125327.63327.63327.04-1 197231972.208327.75327.75326.53-1 197241972.292329.72329.72327.42-1 197251972.375330.07330.07327.23-1 197261972.458329.09329.09326.92-1 197271972.542328.05328.05327.20-1 197281972.625326.32326.32327.37-1 197291972.708324.93324.93327.76-1 1972101972.792325.06325.06328.06-1 1972111972.875326.50326.50328.50-1 1972121972.958327.55327.55328.55-1 197311973.042328.54328.54328.58-1 197321973.125329.56329.56328.86-1 197331973.208330.30330.30328.99-1 197341973.292331.50331.50329.14-1 197351973.375332.48332.48329.62-1 197361973.458332.07332.07329.94-1 197371973.542330.87330.87330.05-1 197381973.625329.31329.31330.42-1 197391973.708327.51327.51330.45-1 1973101973.792327.18327.18330.24-1 1973111973.875328.16328.16330.16-1 1973121973.958328.64328.64329.66-1 197411974.042329.35329.35329.45-1 197421974.125330.71330.71330.12-1 197431974.208331.48331.48330.20-1 197441974.292332.65332.65330.26-1 197451974.375333.19333.19330.2714 197461974.458332.16332.16329.9426 197471974.542331.07331.07330.2324 197481974.625329.12329.12330.2627 197491974.708327.32327.32330.2824 1974101974
Answered 5 days AfterOct 07, 2021

Answer To: SPECIFICATION Create a GUI app that displays the temperature differential from the baseline Celcius...

Sathishkumar answered on Oct 11 2021
133 Votes
full-py/backend.py
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 13 10:44:44 2021
@author: Sathish
"""
import sqlite3
global year,median,upper,lower
year=[]
median=[]
upper=[]
lower=[]
conn = sqlite3.connect('temperature6.db')
print("Opened database successfully")
cursor = conn.execute("S
ELECT YEAR,MEDIAN,UPPER,LOWER from TEMPDATA5")
for row in cursor:
year.append(row[0])
median.append(row[1])
upper.append(row[2])
lower.append(row[3])

print("YEAR = ", row[0])
print("MEDIAN = ", row[1])
print("UPPER = ", row[2])
print("LOWER = ", row[3], "\n")
print("Operation done successfully")
conn.close()
class __ret__():
def __init__(self):
self.year=year
self.median=median
self.upper=upper
self.lower=lower
def getdata(self):

return self.year,self.median,self.upper,self.lower
full-py/database.py
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 11 14:46:42 2021
@author: Sathish
"""
import sqlite3
conn = sqlite3.connect('temperature6.db')
print("Opened database successfully")
conn.execute('''CREATE TABLE TEMPDATA5
(YEAR INT PRIMARY KEY NOT NULL,
MEDIAN FLOAT NOT NULL,
UPPER FLOAT NOT NULL,
LOWER FLOAT);''')
print("Table created successfully")
conn.close()
y=[]
m=[]
u=[]
lo=[]
l1=[]
with open('temperature.txt') as f:
lines=f.readlines()

for i in range(1,len(lines)):
l1=lines[i].split()
y.append(int(l1[0]))
m.append(float(l1[1]))
u.append(float(l1[2]))
lo.append(float(l1[3]))
print(y[1])
import sqlite3
print("Opened database successfully")
for i in range(len(lines)-1):
conn = sqlite3.connect('temperature6.db')

yy=y[i]
mm=m[i]
uu=u[i]
loo=lo[i]
conn.execute("INSERT INTO TEMPDATA5 (YEAR,MEDIAN,UPPER,LOWER) \
VALUES (?, ?, ?, ?)",(yy, mm, uu, loo))
conn.commit()

conn.close()

print("Records created successfully")
full-py/front.py
from tkinter import *
import numpy as np
import matplotlib.pyplot as plt
import backend
from graph import graph
from graph import graph1
from graph import graph2
global year,median,upper,lower
# Created a class object
object1 = backend.__ret__()
year,median,upper,lower=object1.getdata()
#Create an instance of Tkinter frame
win= Tk()
#Set the geometry of tkinter frame
win.geometry("100x250")
def g1():
graph(year,median,upper,lower)
def g2():
graph1(year,median,upper,lower)
def g3():
graph2(year,median,upper,lower)
#Create a button to show the plot
Button(win, text= "X-Y Plot", command= g1).pack(pady=20)
Button(win, text= "Bar Graph", command= g2).pack(pady=20)
Button(win, text= "Linear Regression", command= g3).pack(pady=20)
win.mainloop()
full-py/graph.py
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 13 10:57:25 2021
@author: Sathish
"""
import numpy as np
import matplotlib.pyplot as...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here