Oleg Broytmann doesn't understand my problem

D-Man dsh8290 at rit.edu
Thu May 31 17:54:47 CEST 2001


On Thu, May 31, 2001 at 05:38:30PM +0200, Laura Creighton wrote:
| I don't just have a dictionary, I have arguments and a dictionary. Maybe
| you had better look at http://pmw.sourceforge.net/ or perhaps more
| to the point http://www.pythonware.com/library/tkinter/introduction/x386-backwards-compatibility.htm
| 
| -----  I need to be able to pass both a=b parameters AND a dictionary.

Did you try my suggested code?

def func1( arg1 , arg2 , **kwargs ) :
    print arg1
    print arg2
    print kwargs

def func2( arg1 , arg2 , **kwargs ) :
    func1( arg1 , arg2 , **kwargs )

(I just copied the above functions into a verison 2.1 interactive
interpreter, then tested with the following :)

>>> func2( 13 , { "this" : "is" , "a" : "dict" } , kw1=1 , kw2=2 )
13
{'a': 'dict', 'this': 'is'}
{'kw2': 2, 'kw1': 1}
>>>


It works just the same if you were to put it in a class, then 'arg1'
would be 'self' instead.

HTH,
-D





More information about the Python-list mailing list