python - PyQt QFileInfo error -


i working on app in pyqt , when trying qfileinfo user-selected file error

typeerror: arguments did not match overloaded call: qfileinfo(): many arguments qfileinfo(str): argument 1 has unexpected type 'tuple' qfileinfo(qfile): argument 1 has unexpected type 'tuple' qfileinfo(qdir, str): argument 1 has unexpected type 'tuple' qfileinfo(qfileinfo): argument 1 has unexpected type 'tuple' abort trap: 6 

i have followed every tutorial tee, yet error keeps on happening. code below, , passing string module. don't know need do.

    def __init__(self, r, c):         super().__init__(r, c)         self.check_change = true         self.path = qtwidgets.qfiledialog.getopenfilename(self,'open file',os.getenv('home'), 'csv(*.csv)')                 file_info = qfileinfo(self.path)         file_name = file_info.filename()         #print(file_name)         self.init_ui() 

it looks qtwidgets.qfiledialog.getopenfilename returns tuple. path file looks need example below -- _ placeholder (please see example here: https://pythonspot.com/en/pyqt5-file-dialog/).

self.path, _ = qtwidgets.qfiledialog.getopenfilename(self,'open file',os.getenv('home'), 'csv(*.csv)') 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -