phonebook_app.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:VIRTUAL-PHONE 作者: SumanKanrar-IEM 项目源码 文件源码
def open_sheet(self):
        #self.check_change = False
        path = ('./contacts.csv', 'CSV(*.csv)')
        print(path)
        if path[0] != '':
            with open(path[0], newline='') as csv_file:
                self.table_contacts.setRowCount(0)
                self.table_contacts.setColumnCount(5)
                my_file = csv.reader(csv_file, delimiter=',', quotechar='|')
                for row_data in my_file:
                    row = self.table_contacts.rowCount()
                    self.table_contacts.insertRow(row)
                    if len(row_data) > 10:
                        self.table_contacts.setColumnCount(len(row_data))
                    for column, stuff in enumerate(row_data):
                        item = QTableWidgetItem(stuff)
                        self.table_contacts.setItem(row, column, item)
        #self.check_change = True
        print(self.table_contacts.rowCount())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号