Python Forum

Full Version: .dat file to xlsxl
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Hi buran,

Thanks again for your effort Smile
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'
>>> 
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
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
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.

[Image: Screenshot-20200424-211606.jpg]
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
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:
[Image: Screenshot-20200424-213412.png]
There is nothing with the format. check the axis, but I think the minimum resolution is day. you cannot set resolution in minutes.
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.
I see when i choose cellproperties time in 13:30 for example, its working fine...

[Image: Screenshot-20200424-215131.png]
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
Pages: 1 2 3 4 5