[IronPython] Pass Module Functions as Parameters to Functions

Andrew Evans evans.d.andrew at gmail.com
Thu Feb 10 20:50:01 CET 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://mail.python.org/pipermail/ironpython-users/attachments/20110210/75815d1e/attachment.html>


More information about the Ironpython-users mailing list