From 8499c457fd18ba2d7d8df570504600763d8a2c6c Mon Sep 17 00:00:00 2001 From: mattbk Date: Wed, 15 Nov 2017 22:56:47 +0000 Subject: [PATCH] Move plotly import to top of file. --- pi_temp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pi_temp.py b/pi_temp.py index 3ec8f7c..b632378 100755 --- a/pi_temp.py +++ b/pi_temp.py @@ -48,6 +48,8 @@ from flask import Flask, request, render_template import time import datetime import arrow +import plotly.plotly as py +from plotly.graph_objs import * app = Flask(__name__) app.debug = True # Make this False if you are no longer debugging @@ -143,9 +145,6 @@ def get_records(): @app.route("/to_plotly", methods=['GET']) #This method will send the data to ploty. def to_plotly(): - import plotly.plotly as py - from plotly.graph_objs import * - temperatures, humidities, timezone, from_date_str, to_date_str = get_records() # Create new record tables so that datetimes are adjusted back to the user browser's time zone.