index.py 66.6 KB
Newer Older
git's avatar
git committed
1
#!/usr/bin/python3
git's avatar
git committed
2
# coding: UTF-8
git's avatar
git committed
3 4 5 6 7 8 9 10
import cgi
from urllib.request import urlopen
import sqlite3
import os
import os.path
import time
import datetime
import matplotlib
git's avatar
git committed
11
import matplotlib.path as path
git's avatar
git committed
12 13 14 15 16 17 18
import matplotlib.pyplot as plt
from matplotlib.colors import BoundaryNorm
from matplotlib.ticker import MaxNLocator
import matplotlib.patches as patches
import matplotlib.mlab as mlab
import numpy as np
import dateutil
git's avatar
git committed
19 20 21 22
import cgi
from collections import Counter
form = cgi.FieldStorage()

git's avatar
git committed
23

git's avatar
git committed
24
print("Content-type: text/html; charset=UTF-8\n")
git's avatar
git committed
25 26
debut = """<!DOCTYPE html>
<head>
git's avatar
git committed
27
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
git's avatar
git committed
28 29
    <title>Météorologie au lycee Leonard de Vinci a Soissons</title>
    <meta content="600" http-equiv="refresh" />
git's avatar
git committed
30 31
    <meta content="Meteorologie Mathematiques  informatique et sciences du numerique physique chimie sciences et vie de la terre aeronautique au lycee Leonard de Vinci a Soissons Aisne " name="description"/>
    <meta content="Meteo,Aisne ,Soissons, Maths, Mathematiques, ISN, lycee, Leonard, Vinci, Soissons, SVT, physique, chimie, aeronautique, meteorologie" name="keywords"/>
git's avatar
git committed
32 33
    <meta content="education" name="GENERATOR"/>
    <meta content="Thierry Krebs" name="AUTHOR"/>
git's avatar
git committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
    <style type="text/css">
            html, body {
             margin: 0;
             padding: 0;
             }
            body {
             color: maroon;
             background-color: rgb(200,200,200);
             font-family: Verdana, sans-serif;
             font-size: 100%;
             }
            table, th, td {
             text-align: center;
             border-collapse:separate;
             border-spacing:0px ;
             border-radius: 2px;
             vertical-align: middle;
             }
            table {
             width: 100%;
             border: 1px solid rgb(200,200,200);
             }
            .txt {
             width: 100%;
             border: 1px solid maroon;
             }
            tr, td {
            text-align: center;
            border: 1px solid rgb(220,220,220);
             }
            h1 {
             font-size: 200%;
             color: navy;
             text-align: center;
             }
            h2 {
             font-size: 150%;
             color: white;
             padding-left: 15px;
             }
            p,ul,li,td {
             color: #800000;
             }
            a:link {
             color: #800000;
             text-decoration: underline;
             }
            a:visited {
             color:  white;
             }
            a:hover {
             color: white;
             text-decoration: none;
            }
            a:active, a:focus {
             color: white;
            }
            a.menu:link {
             color: grey;
             text-decoration: none;
             }
            a.menu:visited {
             color: grey;
             text-decoration: none;
             }
            a.menu:hover {
             color: grey;
             text-decoration: none;
             }
            #navigation{
            -webkit-border-radius:5px 5px 5px 5px;
            -moz-border-radius:5px 5px 5px 5px;
            border-radius:5px 5px 5px 5px;
            }
            #global{
            background-color: rgb(206, 210, 232);
            -webkit-box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            -moz-box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            -webkit-border-radius:15px 15px 15px 15px;
            -moz-border-radius:15px 15px 15px 15px;
            border-radius:15px 15px 15px 15px;
            }
            .ombre{
            background-color: rgb(50,50, 50);
            color: white;
            -webkit-box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            -moz-box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            -webkit-border-radius:25px 25px 25px 25px;
            -moz-border-radius:25px 25px 25px 25px;
            border-radius:25px 25px 25px 25px;
            }

            #menu{

            color: grey;
            background-color: rgb(86, 90, 112);
            -webkit-box-shadow: 5px 2px 12px rgba(0.4, 0.4, 0.4, 0.4);
            -moz-box-shadow: 5px 2px 12px rgba(0.4, 0.4, 0.4, 0.4);
            box-shadow: 5px 2px 12px rgba(0.4, 0.4, 0.4, 0.4);
            -webkit-border-radius:15px 15px 15px 15px;
            -moz-border-radius:15px 15px 15px 15px;
            border-radius:15px 15px 15px 15px;
            #global2{
            background-color: white;
            -webkit-box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            -moz-box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.6);
            -webkit-border-radius:15px 15px 15px 15px;
            -moz-border-radius:15px 15px 15px 15px;
            border-radius:15px 15px 15px 15px;
            }
            }
    </style>
    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u="//www.thierrykrebs.eu/owncloud/piwik/";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        paq.push(['setSiteId', '10']);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <!-- End Piwik Code -->
git's avatar
git committed
164
 </head>
git's avatar
git committed
165
  <body>
git's avatar
git committed
166 167 168
    <table  class="txt" style="color:#3F0C0C;">
      <tbody  style="background-color: rgb(240, 240, 240);">
        <tr>
git's avatar
git committed
169
          <td>
git's avatar
git committed
170 171
            <div class="ombre" style="width: 100%;"><B>Lycée
              Léonard de Vinci - Soissons - Station météorologique<br>
git's avatar
git committed
172 173
"""
fin = """
git's avatar
git committed
174

git's avatar
git committed
175 176 177 178 179
  </body>
</html>

"""
print(debut)
git's avatar
git committed
180
#rep="/home/isn"
git's avatar
git committed
181 182
rep = "/home/thkserver"
#rep = os.getcwd()
git's avatar
git committed
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
try:
    os.mkdir(rep + "/meteo")
except:
    print('')
rep=rep+"/meteo"
os.chdir(rep)
rep_meteo=rep
try:
    os.mkdir(rep + "/Sqlite3")
except:
    print('')
rep=rep+"/Sqlite3"
fichierBaseDonnees =rep+"/meteo.sq3"
con=sqlite3.connect(fichierBaseDonnees)
os.chdir(rep)
try:
    con.execute("CREATE TABLE data (jour INTEGER, mois INTEGER, annee INTEGER, heures INTEGER, minutes INTEGER, temperature_ext REAL, humidite_ext REAL, rosee REAL, pres_rel REAL, vit_vent REAL, raf_vent REAL, dir_vent INTEGER, pluie_min REAL, pluie_heure REAL, pluie_tot REAL)")
except:
    print('')
def date():
    dateactuelle=[int(time.strftime("%d")),int(time.strftime("%m")),int(time.strftime("%Y")),int(time.strftime("%H")),int(time.strftime("%M"))]
    return(dateactuelle)

def DateRelecture(tupl):
    NewFormatDate=datetime.datetime.strptime(str(tupl[0])+"/"+str(tupl[1])+"/"+str(tupl[2])+"/"+str(tupl[3])+"/"+str(tupl[4]), "%Y/%m/%d/%H/%M")
    return(NewFormatDate)

def graphe24heures():
    Data=grapheperiode(1)
git's avatar
git committed
212 213 214
#    graphiqueA(1,Data)
#    graphiqueB(1,Data)
#    graphiqueC(1,Data)
git's avatar
git committed
215 216 217 218 219
    return(Data)


def graphe48heures():
    Data=grapheperiode(2)
git's avatar
git committed
220 221 222
#    graphiqueA(2,Data)
#    graphiqueB(2,Data)
#    graphiqueC(2,Data)
git's avatar
git committed
223 224 225 226
    return(Data)

def grapheSemaine():
    Data=grapheperiode(7)
git's avatar
git committed
227 228 229
#    graphiqueA(7,Data)
#    graphiqueB(7,Data)
#    graphiqueC(7,Data)
git's avatar
git committed
230 231 232 233
    return(Data)

def grapheMois():
    Data=grapheperiode(30)
git's avatar
git committed
234 235 236
#    graphiqueA(30,Data)
#    graphiqueB(30,Data)
#    graphiqueC(30,Data)
git's avatar
git committed
237 238 239 240
    return(Data)

def grapheAnnee():
    Data=grapheperiode(365)
git's avatar
git committed
241 242 243
#    graphiqueA(365,Data)
#    graphiqueB(365,Data)
#    graphiqueC(365,Data)
git's avatar
git committed
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
    return(Data)


def LectureData(datedebut,datefin):
    date=[datedebut[0],datedebut[0],datedebut[1],datedebut[0],datedebut[1],datedebut[2],datedebut[0],datedebut[1],datedebut[2],datedebut[3],datedebut[0],datedebut[1],datedebut[2],datedebut[3],datedebut[4]]
    curseur = con.cursor()
    curseur.execute("SELECT * FROM data WHERE (annee>?) or (annee=? and mois>?) or (annee=? and mois=? and jour>?) or (annee=? and mois=? and jour=? and heures>?) or (annee=? and mois=? and jour=? and heures=? and minutes>?) ",date)
    data = list(curseur)
    return(data)

def graphiqueA(periode,Data):
    if periode==2:
        Aname="a2.png"
    if periode==7:
        Aname="a7.png"
    if periode==1:
        Aname="a1.png"
    if periode==30:
        Aname="a30.png"
    if periode==365:
        Aname="a365.png"
    k=0
    X=[]
    Y=[]
    Z=[]
    T=[]
    U=[]
    S=0
    collect=Data[22]
    while k < len(collect):
        date1=str(collect[k][0])+"/"+str(collect[k][1])+"/"+str(collect[k][2])+"/"+str(collect[k][3])+"/"+str(collect[k][4])
        datetime1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        if k==0:
            datedebut1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        if k==len(collect)-1:
            datefin1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        X.append(datetime1)
        Y.append(collect[k][5])
        Z.append(collect[k][7])
        T.append(collect[k][12])
        S=S+collect[k][12]
        U.append(S)
        k=k+1
    k=0
    while k < len(collect):
        k=k+1

    Mint=Data[8][0]
    Maxt=Data[9][0]
    Minr=Data[14][0]
    Maxr=Data[15][0]
    Minp=Data[16][0]
    Maxp=Data[17][0]
git's avatar
git committed
297

git's avatar
git committed
298
    f, axarr = plt.subplots(2, sharex=True,figsize=(8,4), facecolor='#F2F2F2')
git's avatar
git committed
299 300 301 302
    plt.xticks(fontsize = 9)
    axarr[0].plot(X, Y,label='Température',markersize=3,linewidth='1')
    axarr[0].plot(X,Z,label='Point de rosée',markersize=3,linewidth='1')
    axarr[0].legend(loc="upper left", markerscale=3., scatterpoints=1, fontsize=8)
git's avatar
git committed
303 304 305 306
    axarr[0].set_title('Température et point de rosée (°C)')
    axarr[0].axis([datedebut1, datefin1, Minr-5,Maxt+5 ])
    axarr[0].grid(True)

git's avatar
git committed
307
    axarr[1].plot(X,T,label='Pluie',color='m', linewidth='1')
git's avatar
git committed
308
    axarr[1].plot(X,U,label='Pluie cumulée',color='b', linewidth='1')
git's avatar
git committed
309
    axarr[1].legend(loc="upper left", markerscale=3.,fontsize=8, scatterpoints=1)
git's avatar
git committed
310 311 312 313
    axarr[1].set_title('Pluie cumul (mm)')
    axarr[1].axis([datedebut1, datefin1, Minp,U[k-1]+0.2 ])
    axarr[1].grid(True)
    axarr[1].fill_between(X,U, facecolor='#DFF2FF')
git's avatar
git committed
314
    plt.savefig(Aname, facecolor='#F2F2F2',dpi=72)
git's avatar
git committed
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340

def graphiqueC(periode,Data):
    if periode==2:
        Cname="c2.png"
    if periode==7:
        Cname="c7.png"
    if periode==1:
        Cname="c1.png"
    if periode==30:
        Cname="c30.png"
    if periode==365:
        Cname="c365.png"
    k=0
    X=[]
    Y=[]
    Z=[]
    collect=Data[22]
    while k < len(collect):
        date1=str(collect[k][0])+"/"+str(collect[k][1])+"/"+str(collect[k][2])+"/"+str(collect[k][3])+"/"+str(collect[k][4])
        datetime1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        if k==0:
            datedebut1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        if k==len(collect)-1:
            datefin1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        X.append(datetime1)
        Y.append(collect[k][5])
git's avatar
git committed
341
        Z.append([int(collect[k][11]),int(3.6*collect[k][9])])
git's avatar
git committed
342
        k=k+1
git's avatar
git committed
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
    N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
    P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
    T=0
    p=0
    q=0
    while p <= len(Z)-1:
        for j in range (0,16):
            if Z[p][0]>j*11.25 and Z[p][0]<(j+1)*11.25:
                N[j]=N[j]+Z[p][1]
                T=T+Z[p][1]
        p=p+1
    while q <= 15:
        if q+7<=15:
            P[q+7]=round(30*N[q]/T,2)
        else:
            P[q-9]=round(30*N[q]/T,2)
        q=q+1
    #P.reverse()
    properties = ['E', 'ENE', 'NE','NNE', 'N', 'NNO','NO','ONO','O','0SO',
                  'SO','SSO', 'S', 'SSE','SE','ESE']
    values=P
git's avatar
git committed
364
    matplotlib.rc('axes', facecolor = 'white')
git's avatar
git committed
365
    fig = plt.figure(figsize=(5,4.5), facecolor='#F2F2F2')
git's avatar
git committed
366 367 368 369 370 371 372
    axes = plt.subplot(111, polar=True)
    t = np.arange(0,2*np.pi,2*np.pi/len(properties))
    plt.xticks(t, [])
    plt.yticks(np.linspace(0,10,11))
    points = [(x,y) for x,y in zip(t,values)]
    points.append(points[0])
    points = np.array(points)
git's avatar
git committed
373 374 375 376 377 378 379 380
    codes = [path.Path.MOVETO,] + \
            [path.Path.LINETO,]*(len(properties) -1) + \
            [ path.Path.CLOSEPOLY ]
    _path = path.Path(points, codes)
    _patch = patches.PathPatch(_path, fill=True, color='blue', linewidth=0, alpha=.1)
    axes.add_patch(_patch)
    _patch = patches.PathPatch(_path, fill=False, linewidth = 2)
    axes.add_patch(_patch)
git's avatar
git committed
381
    plt.scatter(points[:,0],points[:,1], linewidth=2,
git's avatar
git committed
382
                s=20, color='red', edgecolor='black', zorder=10)
git's avatar
git committed
383 384 385 386 387 388 389 390
    plt.ylim(0,10)
    for i in range(len(properties)):
        angle_rad = i/float(len(properties))*2*np.pi
        angle_deg = i/float(len(properties))*360
        ha = "right"
        if angle_rad < np.pi/2 or angle_rad > 3*np.pi/2: ha = "left"
        plt.text(angle_rad, 10.75, properties[i], size=14,
                 horizontalalignment=ha, verticalalignment="center")
git's avatar
git committed
391
    plt.savefig(Cname, facecolor='#F2F2F2',dpi=72)
git's avatar
git committed
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427


def graphiqueB(periode,Data):
    if periode==2:
        Bname="b2.png"
    if periode==7:
        Bname="b7.png"
    if periode==1:
        Bname="b1.png"
    if periode==30:
        Bname="b30.png"
    if periode==365:
        Bname="b365.png"
    k=0
    X=[]
    Y=[]
    Z=[]
    collect=Data[22]
    while k < len(collect):
        date1=str(collect[k][0])+"/"+str(collect[k][1])+"/"+str(collect[k][2])+"/"+str(collect[k][3])+"/"+str(collect[k][4])
        datetime1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        if k==0:
            datedebut1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        if k==len(collect)-1:
            datefin1=datetime.datetime.strptime(date1, "%d/%m/%Y/%H/%M")
        X.append(datetime1)
        Y.append(collect[k][6])
        Z.append(collect[k][8])
        k=k+1
    k=0
    while k < len(collect):
        k=k+1
    Minp=Data[10][0]
    Maxp=Data[11][0]
    Minh=Data[12][0]
    Maxh=Data[13][0]
git's avatar
git committed
428

git's avatar
git committed
429
    f, axarr = plt.subplots(2, sharex=True,figsize=(8,4),facecolor='#F2F2F2')
git's avatar
git committed
430
    plt.xticks(fontsize = 9)
git's avatar
git committed
431
    axarr[0].plot(X, Y,label='Humidité',color='g', linewidth='1')
git's avatar
git committed
432
    axarr[0].legend(loc="upper left", markerscale=3., scatterpoints=1, fontsize=8)
git's avatar
git committed
433 434 435 436 437
    axarr[0].set_title('Humidité (%)')
    axarr[0].axis([datedebut1, datefin1, Minh-5,Maxh+5 ])
    axarr[0].grid(True)
    axarr[0].fill_between(X,Y , facecolor='#F0FFF0')
    axarr[1].plot(X,Z,label='Pression',color='r', linewidth='1')
git's avatar
git committed
438 439 440
	#axarr[1].fill_between(X,Z,facecolor='#FFBAB2')
    axarr[1].legend(loc="upper left", markerscale=3., scatterpoints=1, fontsize=8)
    axarr[1].set_title('Pression relative (hpa)')
git's avatar
git committed
441 442
    axarr[1].axis([datedebut1, datefin1, Minp-5,Maxp+5 ])
    axarr[1].grid(True)
git's avatar
git committed
443
	#axarr[1].fill_between(X,Z , facecolor='#FFBAB2')
git's avatar
git committed
444
    plt.savefig(Bname, facecolor='#F2F2F2',dpi=72)
git's avatar
git committed
445

git's avatar
git committed
446 447 448 449
def SelectUrlFichierDate(datefichier):
    UrlFichier='http://meteo.ldvsoissons.fr/'+str(datefichier[1])+str(datefichier[2])+'lgcsv.csv'
#    print(UrlFichier)
    return(UrlFichier)
git's avatar
git committed
450 451 452 453


def enreg():
    fiche=15*[]
git's avatar
git committed
454 455 456 457
    datefichier=date()
    UrlFichier= SelectUrlFichierDate(datefichier)
    fiche=GestionNouvDonnees(UrlFichier)
#    print(len(fiche))
git's avatar
git committed
458
    dst=filtrer(fiche)
git's avatar
git committed
459
#    print("fin filtrage")
git's avatar
git committed
460 461 462
    data = open("DonneesActives.csv", "r")
    NouvDonnees=data.readlines()
    for ligne in NouvDonnees:
git's avatar
git committed
463
            # Extraction des données de la ligne séparées par une virgule
git's avatar
git committed
464 465
            ligne
            donnees = ligne.rstrip('\n').split(",")
git's avatar
git committed
466
#            print(donnees)
git's avatar
git committed
467 468 469 470 471
            con.execute("insert into data (jour, mois, annee, heures, minutes, temperature_ext, humidite_ext, rosee, pres_rel, vit_vent, raf_vent, dir_vent, pluie_min, pluie_heure, pluie_tot) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",donnees)
    con.commit()
    data.close()
    return()

git's avatar
git committed
472 473
def GestionNouvDonnees(UrlFichier):
    url = UrlFichier
git's avatar
git committed
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
    with open('meteo.txt', 'wb') as txt:
        txt.write(urlopen(url).read())
    fichier_travail = open('meteo.txt','r')
    NouvDonnees=fichier_travail.readlines()
    fichier_travail.close()
    return(NouvDonnees)

def filtrer(fiche):
    dst = open("DonneesActives.csv", "w")
    Jouridx = 0
    Moisidx = 1
    Anneeidx = 2
    Heureidx = 3
    Minutesidx = 4
    Temperature_extidx = 5
    Humidite_extidx = 6
    Roseeidx = 7
    PressionRelativeidx = 8
    Ventidx = 9
    VentRafaleidx = 10
    DirectionVentidx = 11
    PluieMinuteidx = 12
    PluieHeureidx = 13
    PluieTotalidx = 14
    curseur = con.cursor()
    curseur.execute("SELECT * FROM data ORDER BY annee DESC, mois DESC, jour DESC, heures DESC, minutes DESC LIMIT 1 ")
    last = curseur.fetchone()
    last1=[last[2],last[1],last[0],last[3],last[4]]
    lastlect=DateRelecture(last1)
git's avatar
git committed
503
    print("<I>généré le: ")
git's avatar
git committed
504
    print(lastlect)
git's avatar
git committed
505 506
    suite1='''</I></B>
    		<br>
git's avatar
git committed
507 508
              <a href="http://meteo.ldvsoissons.fr/42017lgcsv.csv">Fichier de
                données</a><br>
git's avatar
git committed
509
              <a href="http://meteo.ldvsoissons.fr/presentation/Presentationmeteoauto.html"><B>Présentation
git's avatar
git committed
510 511
                du projet</B></a>
      </div>
git's avatar
git committed
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564
          </td>
        </tr>'''
    print(suite1)
    for ligne in fiche:
        donnees = ligne.rstrip('\n\r').split(",")
        try:
            if len(last)!=0:
                try:
                        if int(donnees[Anneeidx])>int(last[2]) :
                            dst.write("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" % (donnees[Jouridx], donnees[Moisidx], donnees[Anneeidx], donnees[Heureidx], donnees[Minutesidx], donnees[Temperature_extidx], donnees[Humidite_extidx], donnees[Roseeidx], donnees[PressionRelativeidx], donnees[Ventidx], donnees[VentRafaleidx], donnees[DirectionVentidx], donnees[PluieMinuteidx], donnees[PluieHeureidx], donnees[PluieTotalidx]))
                        elif int(donnees[Anneeidx])==int(last[2]) and int(donnees[Moisidx])>int(last[1]):
                            dst.write("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" % (donnees[Jouridx], donnees[Moisidx], donnees[Anneeidx], donnees[Heureidx], donnees[Minutesidx], donnees[Temperature_extidx], donnees[Humidite_extidx], donnees[Roseeidx], donnees[PressionRelativeidx], donnees[Ventidx], donnees[VentRafaleidx], donnees[DirectionVentidx], donnees[PluieMinuteidx], donnees[PluieHeureidx], donnees[PluieTotalidx]))
                        elif int(donnees[Anneeidx])==int(last[2]) and int(donnees[Moisidx])==int(last[1]) and int(donnees[Jouridx])>int(last[0]):
                            dst.write("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" % (donnees[Jouridx], donnees[Moisidx], donnees[Anneeidx], donnees[Heureidx], donnees[Minutesidx], donnees[Temperature_extidx], donnees[Humidite_extidx], donnees[Roseeidx], donnees[PressionRelativeidx], donnees[Ventidx], donnees[VentRafaleidx], donnees[DirectionVentidx], donnees[PluieMinuteidx], donnees[PluieHeureidx], donnees[PluieTotalidx]))
                        elif int(donnees[Anneeidx])==int(last[2]) and int(donnees[Moisidx])==int(last[1]) and int(donnees[Jouridx])==int(last[0]) and int(donnees[Heureidx])>int(last[3]):
                            dst.write("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" % (donnees[Jouridx], donnees[Moisidx], donnees[Anneeidx], donnees[Heureidx], donnees[Minutesidx], donnees[Temperature_extidx], donnees[Humidite_extidx], donnees[Roseeidx], donnees[PressionRelativeidx], donnees[Ventidx], donnees[VentRafaleidx], donnees[DirectionVentidx], donnees[PluieMinuteidx], donnees[PluieHeureidx], donnees[PluieTotalidx]))
                        elif int(donnees[Anneeidx])==int(last[2]) and int(donnees[Moisidx])==int(last[1]) and int(donnees[Jouridx])==int(last[0]) and int(donnees[Heureidx])==int(last[3]) and int(donnees[Minutesidx])>int(last[4]):
                            dst.write("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" % (donnees[Jouridx], donnees[Moisidx], donnees[Anneeidx], donnees[Heureidx], donnees[Minutesidx], donnees[Temperature_extidx], donnees[Humidite_extidx], donnees[Roseeidx], donnees[PressionRelativeidx], donnees[Ventidx], donnees[VentRafaleidx], donnees[DirectionVentidx], donnees[PluieMinuteidx], donnees[PluieHeureidx], donnees[PluieTotalidx]))

                except:
                    print('')

            else:
                dst.write("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" % (donnees[Jouridx], donnees[Moisidx], donnees[Anneeidx], donnees[Heureidx], donnees[Minutesidx], donnees[Temperature_extidx], donnees[Humidite_extidx], donnees[Roseeidx], donnees[PressionRelativeidx], donnees[Ventidx], donnees[VentRafaleidx], donnees[DirectionVentidx], donnees[PluieMinuteidx], donnees[PluieHeureidx], donnees[PluieTotalidx]))
        except:
                dst.write("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" % (donnees[Jouridx], donnees[Moisidx], donnees[Anneeidx], donnees[Heureidx], donnees[Minutesidx], donnees[Temperature_extidx], donnees[Humidite_extidx], donnees[Roseeidx], donnees[PressionRelativeidx], donnees[Ventidx], donnees[VentRafaleidx], donnees[DirectionVentidx], donnees[PluieMinuteidx], donnees[PluieHeureidx], donnees[PluieTotalidx]))
    dst.close()
    return(dst)

def lectactuelles():
    totaldata=graphe24heures()
    lastref=len(totaldata[22])-1
    act=totaldata[22][lastref]
    dst = open("DonneesActives.csv", "w")
    Jouridx = 0
    Moisidx = 1
    Anneeidx = 2
    Heureidx = 3
    Minutesidx = 4
    Temperature_extidx = 5
    Humidite_extidx = 6
    Roseeidx = 7
    PressionRelativeidx = 8
    Ventidx = 9
    VentRafaleidx = 10
    DirectionVentidx = 11
    PluieMinuteidx = 12
    PluieHeureidx = 13
    PluieTotalidx = 14
    curseur = con.cursor()
    curseur.execute("SELECT * FROM data ORDER BY annee DESC, mois DESC, jour DESC, heures DESC, minutes DESC LIMIT 1 ")
    last = curseur.fetchone()
    donnees=last
git's avatar
git committed
565
    actuelles=[donnees[Jouridx], donnees[Moisidx], donnees[Anneeidx], donnees[Heureidx], donnees[Minutesidx], donnees[Temperature_extidx], donnees[Humidite_extidx], donnees[Roseeidx], donnees[PressionRelativeidx], 3.6*donnees[Ventidx], 3.6*donnees[VentRafaleidx], donnees[DirectionVentidx], donnees[PluieMinuteidx], donnees[PluieHeureidx], donnees[PluieTotalidx]]
git's avatar
git committed
566
    suite2='''
git's avatar
git committed
567 568 569
        <tr>
          <td>
            <table class="txt">
git's avatar
git committed
570 571
              <tbody>
                <tr>
git's avatar
git committed
572 573 574 575 576
                  <td><br></td>
                  <td style="margin-left: -149px;">actuelle</td>
                  <td style="width: 186.65px;">moyenne (24h)</td>
                  <td style="width: 188.767px;">minimum (24h)<br></td>
                  <td style="width: 188.217px;">maximum (24h)<br></td>
git's avatar
git committed
577 578
                </tr>
                <tr>
git's avatar
git committed
579 580
                  <td>Température extérieure (°C)<br></td>
                  <td>'''
git's avatar
git committed
581 582 583 584 585 586 587

    #deb,fi,d,f,h,j,m,l,MinTemp24h,MaxTemp24h,MinPress24h,MaxPress24h,MinHum24h,MaxHum24h,MinRosee24h,MaxRosee24h,MinPluie24h,MaxPluie24h,MinVent24h,MaxVent24h,MinVentR24h,MaxVentR24h,collect

    print(suite2)
    print(donnees[Temperature_extidx])
    print('''<br>
                  </td>
git's avatar
git committed
588
                  <td >''')
git's avatar
git committed
589 590 591
    print(totaldata[23])
    print('''<br>
                  </td>
git's avatar
git committed
592
                  <td >''')
git's avatar
git committed
593
    print(totaldata[8][0])
git's avatar
git committed
594
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
595 596 597 598 599 600 601 602 603 604 605
    print(totaldata[8][1])
    print("-")
    print(totaldata[8][2])
    print("-")
    print(totaldata[8][3])
    print(" à ")
    print(totaldata[8][4])
    print("h")
    print(totaldata[8][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
606
                  <td >''')
git's avatar
git committed
607
    print(totaldata[9][0])
git's avatar
git committed
608
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
609 610 611 612 613 614 615 616 617 618 619 620
    print(totaldata[9][1])
    print("-")
    print(totaldata[9][2])
    print("-")
    print(totaldata[9][3])
    print(" à ")
    print(totaldata[9][4])
    print("h")
    print(totaldata[9][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
621
                  <td >Pression (hPa)<br>
git's avatar
git committed
622
                  </td>
git's avatar
git committed
623
                  <td >''')
git's avatar
git committed
624 625 626
    print(donnees[PressionRelativeidx])
    print('''<br>
                  </td>
git's avatar
git committed
627
                  <td >''')
git's avatar
git committed
628 629 630
    print(totaldata[2])
    print('''<br>
                  </td>
git's avatar
git committed
631
                  <td >''')
git's avatar
git committed
632
    print(totaldata[10][0])
git's avatar
git committed
633
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
634 635 636 637 638 639 640 641 642 643 644
    print(totaldata[10][1])
    print("-")
    print(totaldata[10][2])
    print("-")
    print(totaldata[10][3])
    print(" à ")
    print(totaldata[10][4])
    print("h")
    print(totaldata[10][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
645
                  <td >''')
git's avatar
git committed
646
    print(totaldata[11][0])
git's avatar
git committed
647
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
648 649 650 651 652 653 654 655 656 657 658 659
    print(totaldata[11][1])
    print("-")
    print(totaldata[11][2])
    print("-")
    print(totaldata[11][3])
    print(" à ")
    print(totaldata[11][4])
    print("h")
    print(totaldata[11][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
660
                  <td >Humidité (%)<br>
git's avatar
git committed
661
                  </td>
git's avatar
git committed
662
                  <td >''')
git's avatar
git committed
663 664 665
    print(donnees[Humidite_extidx])
    print('''<br>
                  </td>
git's avatar
git committed
666
                  <td >''')
git's avatar
git committed
667 668 669
    print(totaldata[3])
    print('''<br>
                  </td>
git's avatar
git committed
670
                  <td >''')
git's avatar
git committed
671
    print(totaldata[12][0])
git's avatar
git committed
672
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
673 674 675 676 677 678 679 680 681 682 683
    print(totaldata[12][1])
    print("-")
    print(totaldata[12][2])
    print("-")
    print(totaldata[12][3])
    print(" à ")
    print(totaldata[12][4])
    print("h")
    print(totaldata[12][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
684
                  <td >''')
git's avatar
git committed
685
    print(totaldata[13][0])
git's avatar
git committed
686
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
687 688 689 690 691 692 693 694 695 696 697 698
    print(totaldata[13][1])
    print("-")
    print(totaldata[13][2])
    print("-")
    print(totaldata[13][3])
    print(" à ")
    print(totaldata[13][4])
    print("h")
    print(totaldata[13][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
699
                  <td >Point de rosée (°C)<br>
git's avatar
git committed
700
                  </td>
git's avatar
git committed
701
                  <td >''')
git's avatar
git committed
702 703 704
    print(donnees[Roseeidx])
    print('''<br>
                  </td>
git's avatar
git committed
705
                  <td >''')
git's avatar
git committed
706 707 708
    print(totaldata[4])
    print('''<br>
                  </td>
git's avatar
git committed
709
                  <td>''')
git's avatar
git committed
710
    print(totaldata[14][0])
git's avatar
git committed
711
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
712 713 714 715 716 717 718 719 720 721 722
    print(totaldata[14][1])
    print("-")
    print(totaldata[14][2])
    print("-")
    print(totaldata[14][3])
    print(" à ")
    print(totaldata[14][4])
    print("h")
    print(totaldata[14][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
723
                  <td>''')
git's avatar
git committed
724
    print(totaldata[15][0])
git's avatar
git committed
725
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
726 727 728 729 730 731 732 733 734 735 736 737
    print(totaldata[15][1])
    print("-")
    print(totaldata[15][2])
    print("-")
    print(totaldata[15][3])
    print(" à ")
    print(totaldata[15][4])
    print("h")
    print(totaldata[15][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
738
                  <td>Pluie cumul (mm)<br>
git's avatar
git committed
739
                  </td>
git's avatar
git committed
740
                  <td>''')
git's avatar
git committed
741 742 743
    print(donnees[PluieHeureidx])
    print('''<br>
                  </td>
git's avatar
git committed
744
                  <td>''')
git's avatar
git committed
745 746 747
    print(totaldata[5])
    print('''<br>
                  </td>
git's avatar
git committed
748
                  <td>''')
git's avatar
git committed
749
    print(totaldata[16][0])
git's avatar
git committed
750
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
751 752 753 754 755 756 757 758 759 760 761
    print(totaldata[16][1])
    print("-")
    print(totaldata[16][2])
    print("-")
    print(totaldata[16][3])
    print(" à ")
    print(totaldata[16][4])
    print("h")
    print(totaldata[16][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
762
                  <td>''')
git's avatar
git committed
763
    print(totaldata[17][0])
git's avatar
git committed
764
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
765 766 767 768 769 770 771 772 773 774 775 776
    print(totaldata[17][1])
    print("-")
    print(totaldata[17][2])
    print("-")
    print(totaldata[17][3])
    print(" à ")
    print(totaldata[17][4])
    print("h")
    print(totaldata[17][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
777
                  <td>Vent (km/h)<br>
git's avatar
git committed
778
                  </td>
git's avatar
git committed
779
                  <td>''')
git's avatar
git committed
780
    print(3.6*donnees[Ventidx])
git's avatar
git committed
781 782
    print('''<br>
                  </td>
git's avatar
git committed
783
                  <td>''')
git's avatar
git committed
784 785 786
    print(totaldata[6])
    print('''<br>
                  </td>
git's avatar
git committed
787
                  <td>''')
git's avatar
git committed
788
    print(totaldata[18][0])
git's avatar
git committed
789
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
790 791 792 793 794 795 796 797 798 799 800
    print(totaldata[18][1])
    print("-")
    print(totaldata[18][2])
    print("-")
    print(totaldata[18][3])
    print(" à ")
    print(totaldata[18][4])
    print("h")
    print(totaldata[18][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
801
                  <td>''')
git's avatar
git committed
802
    print(totaldata[19][0])
git's avatar
git committed
803
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
804 805 806 807 808 809 810 811 812 813 814 815
    print(totaldata[19][1])
    print("-")
    print(totaldata[19][2])
    print("-")
    print(totaldata[19][3])
    print(" à ")
    print(totaldata[19][4])
    print("h")
    print(totaldata[19][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
816
                  <td>Vent Rafales (km/h)<br>
git's avatar
git committed
817
                  </td>
git's avatar
git committed
818
                  <td>''')
git's avatar
git committed
819
    print(3.6*donnees[VentRafaleidx])
git's avatar
git committed
820 821
    print('''<br>
                  </td>
git's avatar
git committed
822
                  <td>''')
git's avatar
git committed
823 824 825
    print(totaldata[7])
    print('''<br>
                  </td>
git's avatar
git committed
826
                  <td>''')
git's avatar
git committed
827
    print(totaldata[20][0])
git's avatar
git committed
828
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
829 830 831 832 833 834 835 836 837 838 839
    print(totaldata[20][1])
    print("-")
    print(totaldata[20][2])
    print("-")
    print(totaldata[20][3])
    print(" à ")
    print(totaldata[20][4])
    print("h")
    print(totaldata[20][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
840
                  <td>''')
git's avatar
git committed
841
    print(int(totaldata[21][0]))
git's avatar
git committed
842
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859
    print(totaldata[21][1])
    print("-")
    print(totaldata[21][2])
    print("-")
    print(totaldata[21][3])
    print(" à ")
    print(totaldata[21][4])
    print("h")
    print(totaldata[21][5])
    print('''                  </span></td>
                </tr>
            </tbody>
        </table>
                    48 heures<br>
          </td>
        </tr>
        <tr>
git's avatar
git committed
860 861
          <td>
            <table class="txt">
git's avatar
git committed
862 863
              <tbody>
                <tr>
git's avatar
git committed
864
                  <td><br>
git's avatar
git committed
865 866 867 868 869 870 871 872
                  </td>
                  <td style="text-align: center; width: 186.65px;">moyenne</td>
                  <td style="text-align: center; width: 188.767px;">minimum<br>
                  </td>
                  <td style="text-align: center; width: 188.217px;">maximum<br>
                  </td>
                </tr>
                <tr>
git's avatar
git committed
873
                  <td>Température extérieure (°C)<br>
git's avatar
git committed
874
                  </td>
git's avatar
git committed
875
                  <td>''')
git's avatar
git committed
876 877 878 879
    totaldata=graphe48heures()
    print(totaldata[23])
    print('''<br>
                  </td>
git's avatar
git committed
880
                  <td>''')
git's avatar
git committed
881
    print(totaldata[8][0])
git's avatar
git committed
882
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
883 884 885 886 887 888 889 890 891 892 893
    print(totaldata[8][1])
    print("-")
    print(totaldata[8][2])
    print("-")
    print(totaldata[8][3])
    print(" à ")
    print(totaldata[8][4])
    print("h")
    print(totaldata[8][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
894
                  <td>''')
git's avatar
git committed
895
    print(totaldata[9][0])
git's avatar
git committed
896
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
897 898 899 900 901 902 903 904 905 906 907 908
    print(totaldata[9][1])
    print("-")
    print(totaldata[9][2])
    print("-")
    print(totaldata[9][3])
    print(" à ")
    print(totaldata[9][4])
    print("h")
    print(totaldata[9][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
909
                  <td>Pression (hPa)<br>
git's avatar
git committed
910
                  </td>
git's avatar
git committed
911
                  <td>''')
git's avatar
git committed
912 913 914
    print(totaldata[2])
    print('''<br>
                  </td>
git's avatar
git committed
915
                  <td>''')
git's avatar
git committed
916
    print(totaldata[10][0])
git's avatar
git committed
917
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
918 919 920 921 922 923 924 925 926 927 928
    print(totaldata[10][1])
    print("-")
    print(totaldata[10][2])
    print("-")
    print(totaldata[10][3])
    print(" à ")
    print(totaldata[10][4])
    print("h")
    print(totaldata[10][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
929
                  <td>''')
git's avatar
git committed
930
    print(totaldata[11][0])
git's avatar
git committed
931
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
932 933 934 935 936 937 938 939 940 941 942 943
    print(totaldata[11][1])
    print("-")
    print(totaldata[11][2])
    print("-")
    print(totaldata[11][3])
    print(" à ")
    print(totaldata[11][4])
    print("h")
    print(totaldata[11][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
944
                  <td>Humidité (%)<br>
git's avatar
git committed
945
                  </td>
git's avatar
git committed
946
                  <td>''')
git's avatar
git committed
947 948 949
    print(totaldata[3])
    print('''<br>
                  </td>
git's avatar
git committed
950
                  <td>''')
git's avatar
git committed
951
    print(totaldata[12][0])
git's avatar
git committed
952
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
953 954 955 956 957 958 959 960 961 962 963
    print(totaldata[12][1])
    print("-")
    print(totaldata[12][2])
    print("-")
    print(totaldata[12][3])
    print(" à ")
    print(totaldata[12][4])
    print("h")
    print(totaldata[12][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
964
                  <td>''')
git's avatar
git committed
965
    print(totaldata[13][0])
git's avatar
git committed
966
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
967 968 969 970 971 972 973 974 975 976 977 978
    print(totaldata[13][1])
    print("-")
    print(totaldata[13][2])
    print("-")
    print(totaldata[13][3])
    print(" à ")
    print(totaldata[13][4])
    print("h")
    print(totaldata[13][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
979
                  <td>Point de rosée (°C)<br>
git's avatar
git committed
980
                  </td>
git's avatar
git committed
981
                  <td>''')
git's avatar
git committed
982 983 984
    print(totaldata[4])
    print('''<br>
                  </td>
git's avatar
git committed
985
                  <td>''')
git's avatar
git committed
986
    print(totaldata[14][0])
git's avatar
git committed
987
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
988 989 990 991 992 993 994 995 996 997 998
    print(totaldata[14][1])
    print("-")
    print(totaldata[14][2])
    print("-")
    print(totaldata[14][3])
    print(" à ")
    print(totaldata[14][4])
    print("h")
    print(totaldata[14][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
999
                  <td>''')
git's avatar
git committed
1000
    print(totaldata[15][0])
git's avatar
git committed
1001
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
    print(totaldata[15][1])
    print("-")
    print(totaldata[15][2])
    print("-")
    print(totaldata[15][3])
    print(" à ")
    print(totaldata[15][4])
    print("h")
    print(totaldata[15][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1014
                  <td>Pluie cumul (mm)<br>
git's avatar
git committed
1015
                  </td>
git's avatar
git committed
1016
                  <td>''')
git's avatar
git committed
1017 1018 1019
    print(totaldata[5])
    print('''<br>
                  </td>
git's avatar
git committed
1020
                  <td>''')
git's avatar
git committed
1021
    print(totaldata[16][0])
git's avatar
git committed
1022
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033
    print(totaldata[16][1])
    print("-")
    print(totaldata[16][2])
    print("-")
    print(totaldata[16][3])
    print(" à ")
    print(totaldata[16][4])
    print("h")
    print(totaldata[16][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1034
                  <td>''')
git's avatar
git committed
1035
    print(totaldata[17][0])
git's avatar
git committed
1036
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048
    print(totaldata[17][1])
    print("-")
    print(totaldata[17][2])
    print("-")
    print(totaldata[17][3])
    print(" à ")
    print(totaldata[17][4])
    print("h")
    print(totaldata[17][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1049
                  <td>Vent (km/h)<br>
git's avatar
git committed
1050
                  </td>
git's avatar
git committed
1051
                  <td>''')
git's avatar
git committed
1052 1053 1054
    print(totaldata[6])
    print('''<br>
                  </td>
git's avatar
git committed
1055
                  <td>''')
git's avatar
git committed
1056
    print(totaldata[18][0])
git's avatar
git committed
1057
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068
    print(totaldata[18][1])
    print("-")
    print(totaldata[18][2])
    print("-")
    print(totaldata[18][3])
    print(" à ")
    print(totaldata[18][4])
    print("h")
    print(totaldata[18][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1069
                  <td>''')
git's avatar
git committed
1070
    print(totaldata[19][0])
git's avatar
git committed
1071
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083
    print(totaldata[19][1])
    print("-")
    print(totaldata[19][2])
    print("-")
    print(totaldata[19][3])
    print(" à ")
    print(totaldata[19][4])
    print("h")
    print(totaldata[19][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1084
                  <td>Vent Rafales (km/h)<br>
git's avatar
git committed
1085
                  </td>
git's avatar
git committed
1086
                  <td>''')
git's avatar
git committed
1087 1088 1089
    print(totaldata[7])
    print('''<br>
                  </td>
git's avatar
git committed
1090
                  <td>''')
git's avatar
git committed
1091
    print(totaldata[20][0])
git's avatar
git committed
1092
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
    print(totaldata[20][1])
    print("-")
    print(totaldata[20][2])
    print("-")
    print(totaldata[20][3])
    print(" à ")
    print(totaldata[20][4])
    print("h")
    print(totaldata[20][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1104
                  <td>''')
git's avatar
git committed
1105
    print(int(totaldata[21][0]))
git's avatar
git committed
1106
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117
    print(totaldata[21][1])
    print("-")
    print(totaldata[21][2])
    print("-")
    print(totaldata[21][3])
    print(" à ")
    print(totaldata[21][4])
    print("h")
    print(totaldata[21][5])
    print('''                  </span></td>
                </tr>
git's avatar
git committed
1118 1119
                                <tr>
                  <td class="ombre" colspan="4" rowspan="1"><img style="width: 550px; height: 346px;"
git's avatar
git committed
1120
                      alt="48heures"
git's avatar
git committed
1121
                      src="meteo/Sqlite3/a2.png"><img
git's avatar
git committed
1122
                      style="width: 550px; height: 346px;"
git's avatar
git committed
1123
                      alt="vent"
git's avatar
git committed
1124 1125
                      src="meteo/Sqlite3/b2.png"><div ><img
                      style="width: 240px; height: 212px;"
git's avatar
git committed
1126
                      alt="rose"
git's avatar
git committed
1127
                      src="meteo/Sqlite3/c2.png"><br></div>
git's avatar
git committed
1128 1129 1130 1131 1132 1133 1134 1135
                  </td>
                </tr>
            </tbody>
        </table>
                    Semaine<br>
          </td>
        </tr>
        <tr>
git's avatar
git committed
1136 1137
          <td>
            <table class="txt">
git's avatar
git committed
1138 1139
              <tbody>
                <tr>
git's avatar
git committed
1140
                  <td><br>
git's avatar
git committed
1141 1142 1143 1144 1145 1146 1147 1148
                  </td>
                  <td style="text-align: center; width: 186.65px;">moyenne</td>
                  <td style="text-align: center; width: 188.767px;">minimum<br>
                  </td>
                  <td style="text-align: center; width: 188.217px;">maximum<br>
                  </td>
                </tr>
                <tr>
git's avatar
git committed
1149
                  <td>Température extérieure (°C)<br>
git's avatar
git committed
1150
                  </td>
git's avatar
git committed
1151
                  <td>''')
git's avatar
git committed
1152 1153 1154 1155
    totaldata=grapheSemaine()
    print(totaldata[23])
    print('''<br>
                  </td>
git's avatar
git committed
1156
                  <td>''')
git's avatar
git committed
1157
    print(totaldata[8][0])
git's avatar
git committed
1158
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169
    print(totaldata[8][1])
    print("-")
    print(totaldata[8][2])
    print("-")
    print(totaldata[8][3])
    print(" à ")
    print(totaldata[8][4])
    print("h")
    print(totaldata[8][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1170
                  <td>''')
git's avatar
git committed
1171
    print(totaldata[9][0])
git's avatar
git committed
1172
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184
    print(totaldata[9][1])
    print("-")
    print(totaldata[9][2])
    print("-")
    print(totaldata[9][3])
    print(" à ")
    print(totaldata[9][4])
    print("h")
    print(totaldata[9][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1185
                  <td>Pression (hPa)<br>
git's avatar
git committed
1186
                  </td>
git's avatar
git committed
1187
                  <td>''')
git's avatar
git committed
1188 1189 1190
    print(totaldata[2])
    print('''<br>
                  </td>
git's avatar
git committed
1191
                  <td>''')
git's avatar
git committed
1192
    print(totaldata[10][0])
git's avatar
git committed
1193
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204
    print(totaldata[10][1])
    print("-")
    print(totaldata[10][2])
    print("-")
    print(totaldata[10][3])
    print(" à ")
    print(totaldata[10][4])
    print("h")
    print(totaldata[10][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1205
                  <td>''')
git's avatar
git committed
1206
    print(totaldata[11][0])
git's avatar
git committed
1207
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219
    print(totaldata[11][1])
    print("-")
    print(totaldata[11][2])
    print("-")
    print(totaldata[11][3])
    print(" à ")
    print(totaldata[11][4])
    print("h")
    print(totaldata[11][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1220
                  <td>Humidité (%)<br>
git's avatar
git committed
1221
                  </td>
git's avatar
git committed
1222
                  <td>''')
git's avatar
git committed
1223 1224 1225
    print(totaldata[3])
    print('''<br>
                  </td>
git's avatar
git committed
1226
                  <td>''')
git's avatar
git committed
1227
    print(totaldata[12][0])
git's avatar
git committed
1228
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239
    print(totaldata[12][1])
    print("-")
    print(totaldata[12][2])
    print("-")
    print(totaldata[12][3])
    print(" à ")
    print(totaldata[12][4])
    print("h")
    print(totaldata[12][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1240
                  <td>''')
git's avatar
git committed
1241
    print(totaldata[13][0])
git's avatar
git committed
1242
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254
    print(totaldata[13][1])
    print("-")
    print(totaldata[13][2])
    print("-")
    print(totaldata[13][3])
    print(" à ")
    print(totaldata[13][4])
    print("h")
    print(totaldata[13][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1255
                  <td>Point de rosée (°C)<br>
git's avatar
git committed
1256
                  </td>
git's avatar
git committed
1257
                  <td>''')
git's avatar
git committed
1258 1259 1260
    print(totaldata[4])
    print('''<br>
                  </td>
git's avatar
git committed
1261
                  <td>''')
git's avatar
git committed
1262
    print(totaldata[14][0])
git's avatar
git committed
1263
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274
    print(totaldata[14][1])
    print("-")
    print(totaldata[14][2])
    print("-")
    print(totaldata[14][3])
    print(" à ")
    print(totaldata[14][4])
    print("h")
    print(totaldata[14][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1275
                  <td>''')
git's avatar
git committed
1276
    print(totaldata[15][0])
git's avatar
git committed
1277
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
    print(totaldata[15][1])
    print("-")
    print(totaldata[15][2])
    print("-")
    print(totaldata[15][3])
    print(" à ")
    print(totaldata[15][4])
    print("h")
    print(totaldata[15][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1290
                  <td>Pluie cumul (mm)<br>
git's avatar
git committed
1291
                  </td>
git's avatar
git committed
1292
                  <td>''')
git's avatar
git committed
1293 1294 1295
    print(totaldata[5])
    print('''<br>
                  </td>
git's avatar
git committed
1296
                  <td>''')
git's avatar
git committed
1297
    print(totaldata[16][0])
git's avatar
git committed
1298
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309
    print(totaldata[16][1])
    print("-")
    print(totaldata[16][2])
    print("-")
    print(totaldata[16][3])
    print(" à ")
    print(totaldata[16][4])
    print("h")
    print(totaldata[16][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1310
                  <td>''')
git's avatar
git committed
1311
    print(totaldata[17][0])
git's avatar
git committed
1312
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324
    print(totaldata[17][1])
    print("-")
    print(totaldata[17][2])
    print("-")
    print(totaldata[17][3])
    print(" à ")
    print(totaldata[17][4])
    print("h")
    print(totaldata[17][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1325
                  <td>Vent (km/h)<br>
git's avatar
git committed
1326
                  </td>
git's avatar
git committed
1327
                  <td>''')
git's avatar
git committed
1328 1329 1330
    print(totaldata[6])
    print('''<br>
                  </td>
git's avatar
git committed
1331
                  <td>''')
git's avatar
git committed
1332
    print(totaldata[18][0])
git's avatar
git committed
1333
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344
    print(totaldata[18][1])
    print("-")
    print(totaldata[18][2])
    print("-")
    print(totaldata[18][3])
    print(" à ")
    print(totaldata[18][4])
    print("h")
    print(totaldata[18][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1345
                  <td>''')
git's avatar
git committed
1346
    print(totaldata[19][0])
git's avatar
git committed
1347
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359
    print(totaldata[19][1])
    print("-")
    print(totaldata[19][2])
    print("-")
    print(totaldata[19][3])
    print(" à ")
    print(totaldata[19][4])
    print("h")
    print(totaldata[19][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1360
                  <td>Vent Rafales (km/h)<br>
git's avatar
git committed
1361
                  </td>
git's avatar
git committed
1362
                  <td>''')
git's avatar
git committed
1363 1364 1365
    print(totaldata[7])
    print('''<br>
                  </td>
git's avatar
git committed
1366
                  <td>''')
git's avatar
git committed
1367
    print(totaldata[20][0])
git's avatar
git committed
1368
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379
    print(totaldata[20][1])
    print("-")
    print(totaldata[20][2])
    print("-")
    print(totaldata[20][3])
    print(" à ")
    print(totaldata[20][4])
    print("h")
    print(totaldata[20][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1380
                  <td>''')
git's avatar
git committed
1381
    print(totaldata[21][0])
git's avatar
git committed
1382
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393
    print(totaldata[21][1])
    print("-")
    print(totaldata[21][2])
    print("-")
    print(totaldata[21][3])
    print(" à ")
    print(totaldata[21][4])
    print("h")
    print(totaldata[21][5])
    print('''                  </span></td>
                </tr>
git's avatar
git committed
1394 1395
                                <tr>
                  <td class="ombre" colspan="4" rowspan="1"><img style="width: 550px; height: 346px;"
git's avatar
git committed
1396
                      alt="48heures"
git's avatar
git committed
1397
                      src="meteo/Sqlite3/a7.png"><img
git's avatar
git committed
1398
                      style="width: 550px; height: 346px;"
git's avatar
git committed
1399
                      alt="vent"
git's avatar
git committed
1400 1401
                      src="meteo/Sqlite3/b7.png"><div><img
                      style="width: 240px; height: 212px;"
git's avatar
git committed
1402
                      alt="rose"
git's avatar
git committed
1403
                      src="meteo/Sqlite3/c7.png"></div><br>
git's avatar
git committed
1404 1405 1406 1407 1408 1409 1410 1411
                  </td>
                </tr>
            </tbody>
        </table>
                    Mois<br>
          </td>
        </tr>
        <tr>
git's avatar
git committed
1412 1413
          <td>
            <table class="txt">
git's avatar
git committed
1414 1415
              <tbody>
                <tr>
git's avatar
git committed
1416
                  <td><br>
git's avatar
git committed
1417 1418 1419 1420 1421 1422 1423 1424
                  </td>
                  <td style="text-align: center; width: 186.65px;">moyenne</td>
                  <td style="text-align: center; width: 188.767px;">minimum<br>
                  </td>
                  <td style="text-align: center; width: 188.217px;">maximum<br>
                  </td>
                </tr>
                <tr>
git's avatar
git committed
1425
                  <td>Température extérieure (°C)<br>
git's avatar
git committed
1426
                  </td>
git's avatar
git committed
1427
                  <td>''')
git's avatar
git committed
1428 1429 1430 1431
    totaldata=grapheMois()
    print(totaldata[23])
    print('''<br>
                  </td>
git's avatar
git committed
1432
                  <td>''')
git's avatar
git committed
1433
    print(totaldata[8][0])
git's avatar
git committed
1434
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445
    print(totaldata[8][1])
    print("-")
    print(totaldata[8][2])
    print("-")
    print(totaldata[8][3])
    print(" à ")
    print(totaldata[8][4])
    print("h")
    print(totaldata[8][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1446
                  <td>''')
git's avatar
git committed
1447
    print(totaldata[9][0])
git's avatar
git committed
1448
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460
    print(totaldata[9][1])
    print("-")
    print(totaldata[9][2])
    print("-")
    print(totaldata[9][3])
    print(" à ")
    print(totaldata[9][4])
    print("h")
    print(totaldata[9][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1461
                  <td>Pression (hPa)<br>
git's avatar
git committed
1462
                  </td>
git's avatar
git committed
1463
                  <td>''')
git's avatar
git committed
1464 1465 1466
    print(totaldata[2])
    print('''<br>
                  </td>
git's avatar
git committed
1467
                  <td>''')
git's avatar
git committed
1468
    print(totaldata[10][0])
git's avatar
git committed
1469
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480
    print(totaldata[10][1])
    print("-")
    print(totaldata[10][2])
    print("-")
    print(totaldata[10][3])
    print(" à ")
    print(totaldata[10][4])
    print("h")
    print(totaldata[10][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1481
                  <td>''')
git's avatar
git committed
1482
    print(totaldata[11][0])
git's avatar
git committed
1483
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495
    print(totaldata[11][1])
    print("-")
    print(totaldata[11][2])
    print("-")
    print(totaldata[11][3])
    print(" à ")
    print(totaldata[11][4])
    print("h")
    print(totaldata[11][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1496
                  <td>Humidité (%)<br>
git's avatar
git committed
1497
                  </td>
git's avatar
git committed
1498
                  <td>''')
git's avatar
git committed
1499 1500 1501
    print(totaldata[3])
    print('''<br>
                  </td>
git's avatar
git committed
1502
                  <td>''')
git's avatar
git committed
1503
    print(totaldata[12][0])
git's avatar
git committed
1504
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515
    print(totaldata[12][1])
    print("-")
    print(totaldata[12][2])
    print("-")
    print(totaldata[12][3])
    print(" à ")
    print(totaldata[12][4])
    print("h")
    print(totaldata[12][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1516
                  <td>''')
git's avatar
git committed
1517
    print(totaldata[13][0])
git's avatar
git committed
1518
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530
    print(totaldata[13][1])
    print("-")
    print(totaldata[13][2])
    print("-")
    print(totaldata[13][3])
    print(" à ")
    print(totaldata[13][4])
    print("h")
    print(totaldata[13][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1531
                  <td>Point de rosée (°C)<br>
git's avatar
git committed
1532
                  </td>
git's avatar
git committed
1533
                  <td>''')
git's avatar
git committed
1534 1535 1536
    print(totaldata[4])
    print('''<br>
                  </td>
git's avatar
git committed
1537
                  <td>''')
git's avatar
git committed
1538
    print(totaldata[14][0])
git's avatar
git committed
1539
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550
    print(totaldata[14][1])
    print("-")
    print(totaldata[14][2])
    print("-")
    print(totaldata[14][3])
    print(" à ")
    print(totaldata[14][4])
    print("h")
    print(totaldata[14][5])
    print('''</span><br>
                  </td>
git's avatar
git committed
1551
                  <td>''')
git's avatar
git committed
1552
    print(totaldata[15][0])
git's avatar
git committed
1553
    print("<br><span style='font-size:10px;font-style:italic;'>le  ")
git's avatar
git committed
1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565
    print(totaldata[15][1])
    print("-")
    print(totaldata[15][2])
    print("-")
    print(totaldata[15][3])
    print(" à ")
    print(totaldata[15][4])
    print("h")
    print(totaldata[15][5])
    print('''                  </span></td>
                </tr>
                <tr>
git's avatar
git committed
1566
                  <td>Pluie cumul (mm)<br>
git's avatar
git committed
1567
                  </td>
git's avatar
git committed
1568
                  <td>''')
git's avatar
git committed
1569 1570 1571
    print(totaldata[5])
    print('''<br>
                  </td>
git's avatar
git committed
1572
                  <td>''')