Python: Passing parameters by name

Viewed 17471

Hi I was wondering how to implement this in python. Lets say for example you have a function with two parameters and both print out to console

def myFunc(varA, varB):
    print 'varA=', varA
    print 'varB=', varB

I have seen libraries (pymel being the one that comes to mind) where it allows you to specify the parameter you are parsing data too by name in no specific order. for example

myFunc(varB=12, varA = 'Tom')

I am not sure what I am missing as this doesn't seem to work when I try to declare my own functions inside or outside the maya environment.

Any clues would be wonderful, thank you in advanced.

1 Answers
Related