I'd like to pass the path of a file that I select from my pc
def openFileNameDialog(self):
options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Python Files (*.py)", options=options)
if fileName:
print(fileName)
button = QPushButton('Louvain Algorithm', self) button.setToolTip('This is an example button') button.move(50,300)
button.clicked.connect(self.on_click_louvain)
into an other function
def on_click_louvain(self,fileName):
# Replace this with your networkx graph loading depending on your format !
G = nx.read_gml(str(fileName,))
but i get this error
FileNotFoundError: [Errno 2] No such file or directory: 'False'
Any ideas for the solution??