logo       

Re: PythonString to JavaString: msg#00073

lang.jython.user

Subject: Re: PythonString to JavaString

The __tojava__ method returns the PyObject instance coerced into the
requested Java class.
Sample:
interp.set("A = 'A test String'");
PyObject po = interp.get("A");
String myString = (String)po.__tojava__(java.lang String.class);

If the conversion is not possible then the method returns a
Py.NoConversion object.

Alex.


On 5/29/05, Lieven De Keyzer <lieven_dekeyzer@xxxxxxxxxxx> wrote:
> I've got following code in a Java class:
>
> interp.execfile(inputStream);
> PyObject ob = interp.get("output");
>
> I know this object is a Python string. Is it possible to make it a Java
> String?
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
> _______________________________________________
> Jython-users mailing list
> Jython-users@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/jython-users
>


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise