from PyQt5.QtWidgets import QFileDialog filename = QFileDialog.getOpenFileName(None, "Open File", "", "All Files (*.*)") if filename: print("File selected:", filename[0]) else: print("No file selected.")
from PyQt5.QtWidgets import QFileDialog filenames = QFileDialog.getOpenFileNames(None, "Open Files", "", "All Files (*.*)") if filenames: print("Files selected:", filenames) else: print("No files selected.")In this code, the `QFileDialog.getOpenFileNames` method is called with the same arguments as `getOpenFileName`, but it returns a tuple of file paths instead of a single path. The package library for this module is PyQt5, which is a set of Python bindings for the Qt application framework.