It was the line length
i had entered a numerical value but the wrong value its working now thanks
for your help
concentrating of the indentation and syntax i should put more thought into
the whole thing
thanks again
On Saturday, April 7, 2018 at 9:51:39 PM UTC+1, vigilancewx wrote:
>
> Hell
1. replace -max line length with -10 or whatever your max line length
actually is ie set the amount to go back from the end of the file
2. replace f.readline()[-1] with f.readlines()[-1]
3. google for 'python read last line of text file' and there are several
possible solutions similar to this
Thanks for your input Andrew
your additional comments have removed the indentation errors but for some
reason weewx.sbd has stopped being populated by pond.py and the modified
lines
but again thanks
On Saturday, April 7, 2018 at 9:51:39 PM UTC+1, vigilancewx wrote:
>
> Hello
>
>
> I have a
indentation is significant in python
try:
def read_file(self, event):
try:
with open(self.filename) as f:
# value = f.read()
# line = f.readline()
f.seek(-max_line_length, os.SEEK_END)
line = f.readline()[-1]
Thank you for your reply Andrew
i assume its my error on how i have tried to make the changes to pond py
now its is generating this error
Apr 8 13:23:37 pi-X2 OWFS[21349]:
self.loadServices(config_dict)
Apr 8 13:23:37 pi-X2 OWFS[21349]: File
"/home/weewx/bin/weewx/en
The simplest and probably most efficient way would be to make the script
add the data to two files: 1) the accumulating file you have now and 2) a
single line file which is the one which you read into pond.py
or you could do something like (not tested):
seek to end of file, go back one max line