By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

wxPython and Function problems

P: 1
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:
Expand|Select|Wrap|Line Numbers
  1. def myfunc(kstr , klen):
  2.     ...
  3.     ...
It is called from a button event like this:
Expand|Select|Wrap|Line Numbers
  1. 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?


Oct 28 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,247
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.
Oct 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.