Home > other >  Inquire of passing big circulation all import to QTableWidgetItem fila data
Inquire of passing big circulation all import to QTableWidgetItem fila data

Time:05-04

The from PyQt5. Qt import *
The import OS
The class Playlist_Win (QWidget) :
Def __init__ (self) :
Super () __init__ ()
The self. The initUI ()
Def initUI (self) :
Self. SetWindowTitle (DFF)
The self. The resize (600, 600)
Sd=QHBoxLayout ()
LBK=QTableWidget ()
LBK. SetRowCount (40)
LBK. SetColumnCount (2)
Sd. AddWidget (LBK)
LBK. SetHorizontalHeaderLabels ([' name of the song ', 'address'])
Path="D:/my music" # to traverse the file path,
Dirs=OS. Listdir (path)
For file in dirs:
Print (file)
Q=QTableWidgetItem (file)

LBK. SetItem (0, 0, q)

Self. SetLayout (sd)
If __name__=="__main__" :
App=QApplication (sys. Argv)
Ujbjn=Playlist_Win ()
Ujbjn. The show ()
Sys. Exit (app. Exec_ ())
  • Related