[IronPython] Pass Module Functions as Parameters to Functions

Andrew Evans evans.d.andrew at gmail.com
Thu Feb 10 11:50:01 PST 2011


I am having trouble figuring out the correct way of doing this. I am using
the module cmd.

Anyway this is what I do

import myModule

class Example(cmd.Cmd):
    def __init__(self):
        cmd.Cmd.__init__(self)
        self.prompt = '>>> '

    def do_something(self, myFunction):
        myVar = someFunction(myModule.myFunction)


trying to use myFunction as a keyword argument so when I run it I can use a
function as argument

>>> something Test()

But the syntax I am using isn't right or something

Any ideas?

*cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20110210/75815d1e/attachment.htm>


More information about the Users mailing list