Python using variable outside of a function (and class)
Python using variable outside of a function (and class) Question: i am using PyQt5 to open a browser to get a folder and assign it to a variable folder_path, if i print it inside the function it works: def browse_folder(self): global folder_path options = QtWidgets.QFileDialog.Options() options |= QtWidgets.QFileDialog.ReadOnly folder_path = QtWidgets.QFileDialog.getExistingDirectory( self, "Select Folder", options=options) …