Okay, I've looked around and found a bit of code that make more sense, though it still doesn't work:
# set filename and open file
filename = '/var/log/somefile.log'
file = open(filename, 'r')
#Find file size and move to end
st_results = os.stat(filename)
st_size = st_results[6]
file.seek(st_size)
while 1:
where = file.tell()
line = file.readline()
if not line:
time.sleep(1)
file.seek(where)
else:
self.resultsbox.insertItem(file)
# set filename and open file
filename = '/var/log/somefile.log'
file = open(filename, 'r')
#Find file size and move to end
st_results = os.stat(filename)
st_size = st_results[6]
file.seek(st_size)
while 1:
where = file.tell()
line = file.readline()
if not line:
time.sleep(1)
file.seek(where)
else:
self.resultsbox.insertItem(file)
To copy to clipboard, switch view to plain text mode
but I get an error:
QListBox.insertItem() has an invalid type
What do I need to do to my data to get QlistBox to accept it?
Bookmarks