ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> Jython-users
Jython-users
[Jython-users] call a java-method from embedded interpreter
by Kay other posts by this author
Oct 12 2003 10:58PM messages near this date
Re: AW: [Jython-users] call a java-method from embedded interpreter | Re: [Jython-users] call a java-method from embedded interpreter
Hello!

I want to start the method "run()" (with an embedded interpreter)
from 'MyClass.java', but i'm getting the following exception:

--> 
Traceback (innermost last):   (no code object) at line 0 TypeError: run():
expected 1 args; got 0 <--

... dir() shows "obj1";
The InteractiveConsole starts 'run' without problems!
Do you know, where is the mistake?

Thx!

Regards,
Kay


-=>  App.java <=-
:

Object obj;
:
interp = new PythonInterpreter();
interp.set("obj1", obj);
PyObject pyObject = interp.eval("obj1");
pyObject.__getattr__("run").__call__(); <--- doesn't work?!

:



-=>  MyClass.java <=-

public class MyClass implements Runnable{

    public JFrame frame = new JFrame();


    public void run() {
      System.out.println("Starting...");
      frame.setSize(200,200);
      frame.show();
    }
}

********************************************************************




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Jython-users mailing list
Jython-users@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-users
Thread:
Kay
Diez B. Roggisch

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved