• [^] # Re: Vérifier les données avant d'écrire le fichier

    Posté par . En réponse au message Fichier hist-EXT. Évalué à 1.

    Aille çà bloque la.

    File "readDHT22T.py", line 90
    if s1 = '---' or s2 == '---':
    ^
    SyntaxError: invalid syntax

    #creation du fichier modulus
    #try:
    if True:
     cla = get_c_locale_abbrev()
     s1 = validatePrint(temperature)
     s2 = validatePrint(humidity) 
     if s1 = '---' or s2 == '---':
     old = open(Link_histEXT).read().split('/')
    # Pas propre, mais rapide.
     s1 = old[1]
     s2 = old[2]
     sfile = open(Temp_histEXT,'w')
     sfile.write(cla + " /" + s1 + "/" + s2 + "/1\n")
     sfile.close()
     subprocess.Popen(["/bin/ln","-fs",Temp_histEXT,Link_histEXT])
     #creation du link os.symlink ne marche pas si le fichier est déja linké
     #os.symlink(Temp_histEXT,Link_histEXT)
     subprocess.Popen(["/bin/ln","-fs",Temp_histEXT,Link_histEXT])
    #except:
    # print("unable to create {}".format(Temp_histEXT))