From 4aee433aeab35a2f57916e7b0c42c7d5ba995235 Mon Sep 17 00:00:00 2001 From: Sven Riwoldt Date: Thu, 5 Dec 2024 13:20:27 +0000 Subject: [PATCH] Beginn neue Datei --- CMDB2CSV_Aufbaumaster_0.1.py | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 CMDB2CSV_Aufbaumaster_0.1.py diff --git a/CMDB2CSV_Aufbaumaster_0.1.py b/CMDB2CSV_Aufbaumaster_0.1.py new file mode 100644 index 00000000..7ac169d0 --- /dev/null +++ b/CMDB2CSV_Aufbaumaster_0.1.py @@ -0,0 +1,39 @@ +from PyQt5.QtWidgets import QApplication, QDialog, QFileDialog +from PyQt5.uic import loadUi +import sys, os, re +from pathlib import Path +import pandas as pd +from icecream import ic +import numpy as np +import json +import logging + + +class A2CSV(QDialog): # erbt von QDialog + def __init__(self): + # super (MainUI, self).__init__() #Aufrufen des Konstruktors von QDialog + super().__init__() + loadUi("AM2CSV.ui", self) + self.pB_open.clicked.connect(self.open_file_dialog) + self.filename = None + self.onlyfilename = None + self.path = None + + + + def open_file_dialog(self): + self.filename, _ = QFileDialog.getOpenFileName(self,"Aufbaumaster","\\Volumes\\Daten01\\Documents\\toCSV","Images (*.xls *.xlsx *.xlsb)") + #self.lblCMDBPath.setText(self.filename) + + + if self.filename: + self.path = Path(self.filename) + self.onlyfilename = os.path.basename(self.filename) + self.lb_selected_aufbaumaster.setText(self.onlyfilename) + + +if __name__ == "__main__": + app = QApplication(sys.argv) + ui = A2CSV() + ui.show() + app.exec_() \ No newline at end of file