Posts: 115
Threads: 10
Joined: Nov 2019
Hi buran,
Thanks again for your effort
When i run the above code, i get the following error:
Traceback (most recent call last):
File "C:\Users\Makada\Desktop\dat to csv kopie.py", line 22, in <module>
last_update = df.TMSTAMP.iat[-1]
File "C:\Python\lib\site-packages\pandas\core\generic.py", line 5274, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'TMSTAMP'
>>>
Posts: 8,159
Threads: 160
Joined: Sep 2016
it's probably something with your data/file. it was the same also in previous code and it was working, right.
Probably you should put some more effort debugging yourself
Posts: 8,159
Threads: 160
Joined: Sep 2016
Apr-24-2020, 06:42 PM
(This post was last modified: Apr-24-2020, 06:42 PM by buran.)
Note that you must delete the empty file you currently have in place. You either don't have file with taht name or have file with data. empty file with the same name will not work
Posts: 115
Threads: 10
Joined: Nov 2019
Apr-24-2020, 07:20 PM
(This post was last modified: Apr-24-2020, 07:20 PM by Makada.)
Yes youre right, i had to remove the old outputfile first, then the new code will make one itself.
I see it append sometimes one record, sometimes 2 when it is running.
Posts: 8,159
Threads: 160
Joined: Sep 2016
time.sleep cannot guarantee precise 60 seconds interval. from the docs:
Quote:The actual suspension time may be less than that requested because any caught signal will terminate the sleep() following execution of that signal’s catching routine. Also, the suspension time may be longer than requested by an arbitrary amount because of the scheduling of other activity in the system
also, start wasn't exactly at the second, I guess
by the way, it's strange you get also microseconds in datetime columne
Posts: 115
Threads: 10
Joined: Nov 2019
Apr-24-2020, 07:36 PM
(This post was last modified: Apr-24-2020, 07:36 PM by Makada.)
Yes these microseconds are output from my datalogger.
I dont know how to remove them.
Re the 60 seconds sleep inaccuracy;
Is this method more secure?
schedule.every().minute.at(":01").do(task1)
while True:
schedule.run_pending()
time.sleep(1)
refresh() I noticed theres something with the time format.
As you can see in excel:
Posts: 8,159
Threads: 160
Joined: Sep 2016
There is nothing with the format. check the axis, but I think the minimum resolution is day. you cannot set resolution in minutes.
Posts: 8,159
Threads: 160
Joined: Sep 2016
as to your other question
Quote:How can I make sure long-running jobs are always executed on time?
Schedule does not account for the time it takes the job function to execute. To guarantee a stable execution schedule you need to move long-running jobs off the main-thread (where the scheduler runs). See “How to execute jobs in parallel?” in the FAQ for a sample implementation.
Posts: 115
Threads: 10
Joined: Nov 2019
I see when i choose cellproperties time in 13:30 for example, its working fine...
Posts: 8,159
Threads: 160
Joined: Sep 2016
that is just time. In the other column you have date. Did you check what is minimum resolution there...
And sorry, but I am moving away from this thread...I cannot answer all you questions. You need to put more effort yourself. sorry
|