简体   繁体   English

Jython - 将 Java 数组与 Java 字符串转换为 Python 列表与 ZA7F417F35426B56927

[英]Jython - Convert Java array with Java Strings to Python list with Python strings

I'm using some Oracle API with Jython2.5.我正在使用一些 Oracle API 和 Jython2.5。 Once of the methods returns:一旦方法返回:

array(java.lang.String)

I would like to convert this to a python list, with strings as the elements in the list.我想将其转换为 python 列表,其中字符串作为列表中的元素。 eg例如

['some', 'strings']

I'm not sure how to do this, or if there's a simple method in the java.lang or java.utils library I can use for the conversion.我不确定如何执行此操作,或者 java.lang 或 java.utils 库中是否有一个简单的方法可以用于转换。

EDIT: https://docs.oracle.com/cd/E10530_01/doc/epm.931/html_security_api/javadoc/com/hyperion/css/common/CSSGroupIF.html EDIT: https://docs.oracle.com/cd/E10530_01/doc/epm.931/html_security_api/javadoc/com/hyperion/css/common/CSSGroupIF.html

method GetGroupLists()方法 GetGroupLists()

You may use "tolist" on an array to convert it to a list:您可以在数组上使用“tolist”将其转换为列表:

grouplist = GetGroupList().tolist()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM