Display directory pyqt4 and Python

Dunwitch dunwitch at gmail.com
Thu Apr 2 04:30:28 CEST 2009

I've looked around for the answer and have decided to ask an expert
for the solution. Whats suppose to happen is a user pushes a button
and displays the directory content in the text edit window on the gui.
Everything works, apart from the fact that it only shows the last file
in the directory, not a full listing. Here is the code for reference.
Any help would be appreciated, I'm missing something simple.

# File : Video Search
import sys, os, win32net

from PyQt4 import QtGui, QtCore
from findVideos import Ui_MainWindow # UI Files from QT Designer

# New class derived from QMainWindow
class TestApp(QtGui.QMainWindow):
    def __init__(self):
        self.ui = Ui_MainWindow()

        # Connect the signals andslots
()"), self.showVideoFiles)

#----------------------------- Code In Question
    def showVideoFiles(self):
        enc7 = ('\\\\\\somefolder')
        for x in (fileList):
            self.ui.displayVideo.setText(x) # This only shows the last
file in the directory?

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    window = TestApp()

More information about the Python-list mailing list