From: <joh...@no...> - 2009-11-05 09:45:09
|
Well I assumed I'd have to create a PyModule and invoke a function on it... > -----Original Message----- > From: Alex Grönholm [mailto:ale...@ne...] > Sent: 04 November 2009 17:27 > To: jyt...@li... > Subject: Re: [Jython-users] Invoking a function on a module > > joh...@no... kirjoitti: > > > > Hello, > > > > I've looked at the Python API docs but feel that a few common > examples > > would be of use. For example, I can pass a String to > PythonInterpreter > > and execute it, but how can I invoke the method 'test' on the module > > 'mymodule.py', which is in the classpath? Or even better, if my > > classpath contains a directory 'mypackage', and the module lives > > inside it, how do I do: > > > > import mypackage.mymodule > > > > mypackage.mymodule.test('params') > > > > through the Python API? > > > Just exec() those statements one after another. Shouldn't be that > difficult to figure out :) > > > > Thanks, > > > > > > John > > > > > > > > This e-mail (including any attachments) is confidential, may contain > > proprietary or privileged information and is intended for the named > > recipient(s) only. Unintended recipients are prohibited from taking > > action > > on the basis of information in this e-mail and must delete all copies. > > Nomura will not accept responsibility or liability for the accuracy > or > > completeness of, or the presence of any virus or disabling code in, > this > > e-mail. If verification is sought please request a hard copy. Any > > reference > > to the terms of executed transactions should be treated as > preliminary > > only > > and subject to formal written confirmation by Nomura. Nomura reserves > the > > right to monitor e-mail communications through its networks (in > > accordance > > with applicable laws). No confidentiality or privilege is waived or > > lost by > > Nomura by any mistransmission of this e-mail. Any reference to > > "Nomura" is > > a reference to any entity in the Nomura Holdings, Inc. group. Please > read > > our Electronic Communications Legal Notice which forms part of this > > e-mail: > > http://www.Nomura.com/email_disclaimer.htm > > --------------------------------------------------------------------- > --- > > > > --------------------------------------------------------------------- > --------- > > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > > trial. Simplify your report design, integration and deployment - and > focus on > > what you do best, core application coding. Discover what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > --------------------------------------------------------------------- > --- > > > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > https://lists.sourceforge.net/lists/listinfo/jython-users > > > > > ----------------------------------------------------------------------- > ------- > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users This e-mail (including any attachments) is confidential, may contain proprietary or privileged information and is intended for the named recipient(s) only. Unintended recipients are prohibited from taking action on the basis of information in this e-mail and must delete all copies. Nomura will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in, this e-mail. If verification is sought please request a hard copy. Any reference to the terms of executed transactions should be treated as preliminary only and subject to formal written confirmation by Nomura. Nomura reserves the right to monitor e-mail communications through its networks (in accordance with applicable laws). No confidentiality or privilege is waived or lost by Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is a reference to any entity in the Nomura Holdings, Inc. group. Please read our Electronic Communications Legal Notice which forms part of this e-mail: http://www.Nomura.com/email_disclaimer.htm |