Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Thx, but do I need a __init__() function? And do I need to add self in the function who is in the main file? Commented Aug 5, 2021 at 2:16
  • @W1L74680. I don't think you need an __init__ function. And yes, you need to create an instance of the class to access the different function. Now, you want to access clear(). So you would do from functions import functions then functions.clear() where functions is the class and clear() is the function Commented Aug 5, 2021 at 2:22
  • What I was meaning, it's do you write functions in main.py like this: functions.clear(self) or like that functions.clear() Commented Aug 5, 2021 at 2:26
  • @W1L74680. The second one. The self parameter can help us access the attributes. Not need to pass self as a parameter Commented Aug 5, 2021 at 2:28