basic doubt

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Jun 17 04:11:59 EDT 2010


En Thu, 17 Jun 2010 02:06:54 -0300, madhuri vio <madhuri.vio at gmail.com>  
escribió:

> def h(self,event):
>     handle = open("myco.fasta","r")
>     for seq_record in SeqIO.parse(handle, "fasta"):
>          messenger_rna = coding_myco.fasta.transcribe()
>          han1 = open("mycorna.fasta","wU")
>          han1.close()
>          return self.messenger_rna
>
>
> the error is...
>
> File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
>     return self.func(*args)
> TypeError: h() takes exactly 2 arguments (0 given)
>
>  ia m unable to debug...i am stuck

This is just a guess, but looks like your h function is a plain function,  
not a method, so it doesn't take a "self" parameter. Also, you are  
probably using it in some place where the callback doesn't receive any  
additional arguments (like a Button command).
Try with def f(): ...
If it doesn't work, show us the part where h is used.

-- 
Gabriel Genellina




More information about the Python-list mailing list