Ich bin ein Pythonneuling und habe versucht für meinen Ras.Pi. eine Wetterstation aus den verschiedensten Quellen zusammen zufummeln!
Nun habe ich ein Lieber Problem bei dem ich ohne eure Hilfe nicht weiter kommen werde.
Ich bekomme diese Fehlermeldung:
Code: Alles auswählen
pi@raspberrypi ~/project $ sudo python readsensors.py
Traceback (most recent call last):
File "readsensors.py", line 159, in <module>
writeHTML(tempExt, tempInt, humid, press)
File "readsensors.py", line 142, in writeHTML
curr.write(+str(vNow)+';'+str(round(to,1))+';'+str(ti)+';'++str(round(pa,1))+';'+str(hu)+'\n')
TypeError: bad operand type for unary +: 'str'
Zeile 2 ist 142
Code: Alles auswählen
curr = open("/home/pi/project/web/current.txt", "w")
curr.write(+str(vNow)+';'+str(round(to,1))+';'+str(ti)+';'++str(round(pa,1))+';'+str(hu)+'\n')
curr.close()
#------------------------------------------------------------------------
# Main program
#------------------------------------------------------------------------
tempExt = readDS18B20()
humid = readDHT11()
tempInt, press = readBMP()
#write to RRD archive
cmd = '/usr/bin/rrdtool update /home/pi/project/weatherRRD.rrd -t tempo:tempi:press:humid N:'
cmd = cmd +str(tempExt)+':'+str(tempInt)+':'+str(Press)+':'+str(humid)
cmdStat, cmdOut = commands.getstatusoutput(cmd)
dbgprint("RRD write result: "+str(cmdStat))
writeHTML(tempExt, tempInt, humid, press )
dbgprint ("End!")