Python Forum
what is wrong with my code?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what is wrong with my code?
#1
from PyQt5 import QtCore, QtGui, QtWidgets
import sqlite3
from PyQt5.QtWidgets import QMainWindow, QApplication,QFileDialog,QLabel
import os

def get_file_name(self):

        file_filter= "data file (*.SQLite3)"
        fname = QFileDialog.getOpenFileName(
            parent=self,
            caption="select a file",
            directory=os.getcwd(),
            filter=file_filter
        )

        print(fname)
get_file_name()
Error:
TypeError: get_file_name() missing 1 required positional argument: 'self'
Reply


Messages In This Thread
what is wrong with my code? - by 53535 - Apr-26-2022, 11:12 AM
RE: what is wrong with my code? - by ndc85430 - Apr-26-2022, 11:27 AM
RE: what is wrong with my code? - by ndc85430 - Apr-26-2022, 11:28 AM
RE: what is wrong with my code? - by 53535 - Apr-27-2022, 12:36 AM
RE: what is wrong with my code? - by deanhystad - Apr-26-2022, 05:12 PM
RE: what is wrong with my code? - by 53535 - Apr-27-2022, 12:37 AM
RE: what is wrong with my code? - by Axel_Erfurt - Apr-26-2022, 06:12 PM
RE: what is wrong with my code? - by 53535 - Apr-27-2022, 12:31 AM
RE: what is wrong with my code? - by deanhystad - Apr-27-2022, 03:14 AM
RE: what is wrong with my code? - by 53535 - Apr-27-2022, 03:58 AM
RE: what is wrong with my code? - by Axel_Erfurt - Apr-27-2022, 08:53 PM
RE: what is wrong with my code? - by 53535 - Apr-28-2022, 01:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  something is wrong with my code 53535 9 2,368 Apr-27-2022, 10:06 AM
Last Post: 53535

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020