Open eftalgezer opened 1 month ago
Would splitting the log string at new line and then running a reverse loop achieve the same function?
Would splitting the log string at new line and then running a reverse loop achieve the same function?
Can you elaborate?
with open(settings.get_log(), 'r') as log_file:
data = log_file.readlines()
for i in range(-1,-len(data), -1):
...
This would achieve the same effect. We can also use data.reverse
or reversed(data)
. But this is more efficient.
with open(settings.get_log(), 'r') as log_file: data = log_file.readlines() for i in range(-1,-len(data), -1): ...
This would achieve the same effect. We can also use
data.reverse
orreversed(data)
. But this is more efficient.
It is unrelevant. The current implementation writes the output of subprocess.Popen
to the log file. Popen
runs SIESTA. SIESTA gives many output in a certain timeframe and one should save the whole output from SIESTA to the log file as it comes. Also, one needs to see those flowing outputs.
Without this package, one runs SIESTA from the terminal as follows
siesta system.fdf > log &
And then, runs the following command to see every incoming output
tail -f log
It is not possible to use >
with subprocess
, and also run tail
, so we direct the SIESTA's output to a file and write into it as it comes. Normally, one does it with >
. And since it is not possible to run tail
, we use sh
package's tail
.
Remove sh package and find another equivalent for Linux's tail functionality to broaden OS support.