title: How to choose multiple files from file dialog and open at the same time and access them
body: <pre><code>from PyQt5 import QtWidgets
  from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QFileDialog
  from PyQt5 import QtCore
  import sys
   
   
  def dialog():
      file , check = QFileDialog.getOpenFileName(None, &quot;QFileDialog.getOpenFileName()&quot;,
                      &quot;&quot;, &quot;All Files (*);;Python Files (*.py);;Text Files (*.txt)&quot;)
      if check:
          print(file)
   
  app = QApplication(sys.argv)
  win = QMainWindow()
  win.setGeometry(400,400,300,300)
  win.setWindowTitle(&quot;CodersLegacy&quot;)
    
  button = QPushButton(win)
  button.setText(&quot;Press&quot;)
  button.clicked.connect(dialog)
  button.move(50,50)
   
  win.show()
  sys.exit(app.exec_())
  </code></pre>
  <p>Here is the code to select and open a single file when I press a button. However, how can this is changed to select multiple files and open at the same time. I tried for the syntax, unfortunately, I could not find one.</p>