Skip to content

Commit ac6b105

Browse files
authored
Update main.py
1 parent 31a92c5 commit ac6b105

File tree

1 file changed

+2
-12
lines changed
  • Leer archivos excel con pandas

1 file changed

+2
-12
lines changed

Leer archivos excel con pandas/main.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@ class MiApp(QtWidgets.QMainWindow):
1111
def __init__(self):
1212
super().__init__()
1313
self.ui = Ui_MainWindow()
14-
self.ui.setupUi(self)
15-
14+
self.ui.setupUi(self)
1615
self.ui.bt_abrir.clicked.connect(self.abrir_archivo)
1716
self.ui.pushButton.clicked.connect(self.crear_tabla)
1817

19-
2018
def abrir_archivo(self):
2119
file = QFileDialog.getOpenFileName(self,"Abrir Archivo Excel", "","Excel Files (*.xlsx) ;; All Files (*)")
2220
self.direccion = file[0]
2321

24-
2522
def crear_tabla(self):
2623
try:
2724
df = pd.read_excel(self.direccion)
@@ -38,9 +35,7 @@ def crear_tabla(self):
3835
except FileNotFoundError:
3936
QMessageBox.about (self,'Informacion', 'El archivo esta \n malogrado')
4037
return None
41-
4238
#print(x, y)
43-
4439
self.ui.tableWidget.setRowCount(y)
4540
self.ui.tableWidget.setColumnCount(x)
4641

@@ -54,13 +49,8 @@ def crear_tabla(self):
5449
dato =''
5550
self.ui.tableWidget.setItem(i,j, QTableWidgetItem(dato))
5651
#print(df_fila)
57-
58-
59-
6052
if __name__ == "__main__":
6153
app = QtWidgets.QApplication(sys.argv)
6254
mi_app = MiApp()
6355
mi_app.show()
64-
sys.exit(app.exec_())
65-
66-
56+
sys.exit(app.exec_())

0 commit comments

Comments
 (0)