Python / Python 2.7.3 path definition

I am trying to figure out a simple python path, but I always get an error. Can someone please tell me how to set the correct path. I'm working on Raspberry Pi.

Here's the code that doesn't work:

import re, os, rrdtool, time, sys


# define pathes to 1-wire sensor data
pathes = "/sys/bus/w1/devices/10-000801ddae93/w1_slave"

      

and

# insert data into round-robin-database
rrdtool.update(
"%s/temperature.rrd" % (os.path.dirname(os.path.abspath(__file__))),
data)

      

the errors I am getting:

07/27/15 13:21:37 Error reading s :  [Errno 2] No such file or directory: 's'
07/27/15 13:21:39 Error reading y :  [Errno 2] No such file or directory: 'y'
07/27/15 13:21:40 Error reading s :  [Errno 2] No such file or directory: 's'
07/27/15 13:21:41 Error reading / :  [Errno 21] Is a directory: '/'
07/27/15 13:21:42 Error reading b :  [Errno 2] No such file or directory: 'b'
07/27/15 13:21:44 Error reading u :  [Errno 2] No such file or directory: 'u'
07/27/15 13:21:45 Error reading s :  [Errno 2] No such file or directory: 's'
07/27/15 13:21:46 Error reading / :  [Errno 21] Is a directory: '/'
07/27/15 13:21:48 Error reading w :  [Errno 2] No such file or directory: 'w'
07/27/15 13:21:49 Error reading 1 :  [Errno 2] No such file or directory: '1

      

" etc.....

and

Traceback (most recent call last):
  File "/home/pi/python.py", line 39, in <module>
    data)
error: /home/pi/temperature.rrd: found extra data on update argument: U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U

      

I hope u can help me.

+3


source to share


1 answer


update () is probably expecting a list type or something you can iterate over.



Try ... update ([....])

0


source







All Articles