Home>
I am measuring the latitude and longitude of GPS in a log file and outputting it to the log file every 3 seconds. How can I get only the end of the log file?
-
Answer # 1
-
Answer # 2
What about the
tail
command? -
Answer # 3
I don't really answer questions that don't have a code at all ...
python doesn't work unless the indentation is correcttail-like implementation (3 lines)
import sys import collections deque = collections.deque (maxlen = 3) for line in sys.stdin.readlines (): deque.append (line) for line in deque: print (line, end = "")
Related articles
- python - how to extract only the date from datetime64 [ns] type
- python - i don't know the cause of the error
- python - how to output the key and value in the dictionary in any form
- semicolon at the end of a php statement
- php - when i output it,% is added at the end
- python scraping article csv output
- python - i want the block to disappear when the ball hits the block
- i want to read excel data with python and output duplicate lines as csv or excel data
- python - i want to find the mode of a pixel with a pixel value of 1 or more
- python - about the output order of set {}
- python - what are the frequency axis and time axis in scipysignalstft?
- python - the link created with the collected path does not open
- python - delete bom on the command line
- python 3x - how to get the value of scrolledtext
- python - the csv file cannot be displayed
- python - i want to design a cnn with 2 inputs and 1 output with keras
- [python] graphviz output format error
- python 3x - i can't get the text of the span tag using selenium
- python - how to delete an apostrophe in the list
- python - (tensorflow) please tell me how to save and output image data mnist
Trends
Do you want only the last log?
What if you prepare a file for overwriting separately from the log file output (append)?
The file is always overwritten at the timing of log output.
I am sorry if the intention is different.