Thank you. You have successfully solved this problem and obtained the file path and name. Now I have another problem
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout
from PyQt5.QtGui import *
import sys
class Window(QWidget):
def __init__(self):
super().__init__()
layout = QVBoxLayout()
for arg in sys.argv: # <1> sys.argv is a list of strings.
l = QLabel(arg)
layout.addWidget(l)
self.setWindowIcon(QIcon('resource/logo.ico'))
self.setLayout(layout)
self.setWindowTitle("Arguments")
app = QApplication(sys.argv)
w = Window()
w.show()
app.exec_()
I want to add a program icon
self.setWindowIcon(QIcon(‘resource/logo.ico’))
It can be displayed normally
But I use pyinstaller to package and generate exe
pyinstaller -w test20.py
When the .MP4 video file on the desktop of the computer is opened through test20.exe, it will not be normal displayed. That’s why I can only copy one picture to the desktop,This is not the way to do it