Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.dat file to xlsxl
#31
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'
>>> 
Reply
#32
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#33
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#34
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]
Reply
#35
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#36
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]
Reply
#37
There is nothing with the format. check the axis, but I think the minimum resolution is day. you cannot set resolution in minutes.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#38
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.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#39
I see when i choose cellproperties time in 13:30 for example, its working fine...

[Image: Screenshot-20200424-215131.png]
Reply
#40
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020