I am able to open a terminal from my python service to tail certain file that I want. However, if there are many files that I want to tail sequentially, the following code will launch a new terminal for each file. How do I force to always reuse the same terminal window?
def tail_logging(title, file_to_tail):
os.system(
"DISPLAY=:0.0 XAUTHORITY=/data/.Xauthority gnome-terminal --name 'Todd' -t "
+ title
+ ' -- /bin/bash -c "tail -f '
+ file_to_tail
+ '"'
)
for i in range(3):
tail_logging("Same", str(i))