wxPython and Function problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MaxVK
    New Member
    • Oct 2008
    • 1

    wxPython and Function problems

    Hi there, I'm a very new Python user and I am using Boa Constructor and Python. Unfortunately I'm having a problem when creating a function.

    I have this function:
    Code:
    def myfunc(kstr , klen):
        ...
        ...
    It is called from a button event like this:
    Code:
    x = myfunc(a , b)
    but I get an error saying that "myfunc() takes exactly 2 arguments (3 given)"

    I have no idea what is wrong, since as far as I can see I'm passing the correct number of arguments to the function.

    Could anyone help please?

    Regards

    Max
    Last edited by numberwhun; Oct 28 '08, 03:50 PM. Reason: Please use code tags
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    #2
    The function probably also gets the 'self'-argument passed. This argument tells the function which object called it. I'm not entirely sure, I'm not that advanced in python, but you can find more info on it here.

    Comment

    Working...