Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Before I tell you the solution, you need to understand exactly what the problem is:
- Open() takes exactly 3 arguments (2 given)
- This means that a function is expecting to recieve 3 informations:
- def new_func(arg1, arg2, arg3):
- print("this func works!")
- # new_func(1, 2) # This won't work because we're only sending 2 infos
- new_func(1, 2, 3) # This will work since the func is expecting 3 arguments
- Now, with that in mind, let's indentify the problem:
- # So, we know that the open is getting 3 arguments
- def Open(self, title,days):
- # And we're calling the function with this:
- self.privateShopBuilder.Open(self.inputDialog.GetText())
- We now know that it's wrong since the function is expecting 3 infos and we are sending it once
- This means that we probably want to do this... right?
- self.privateShopBuilder.Open(1, 2, 3)
- Well, yes (the logical is correct) but in this case, it's wrong.
- In the beginning of the function, notice the word self. I can go to a deep explanation but it's not relevant to the topic. Let's just say you can ignore since it's used to represent the class where the function is.
- But what does that mean?
- Remember the initial error?
- Open() takes exactly 3 arguments (2 given)
- The function is recieving 2 arguments: self and title.
- We need to send 2 infos, instead of 1:
- def Open(self, title,days): # title and days
- self.privateShopBuilder.Open(self.inputDialog.GetText()) # we're ONLY sending title, where's the "days"?
- You probably didn't follow the tutorial at interfarcemodule.py, check the files again.
- Quick solution:
- self.privateShopBuilder.Open(self.inputDialog.GetText(), 1) # The 1 represents the day, probably how many days to open an offline shop (?)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement