[Py4j-users] How to access attributes ?
Status: Beta
Brought to you by:
barthe
From: Wilfried F. <wil...@gm...> - 2014-12-04 03:30:39
|
Hi, I am testing py4j and I would like to know if it is possible to access class attributes. In the Stack class from the getting started page, I added : public static final String test1 = "TEST"; public static final int test2 = 12; public int test3 = 12; and with python 2.7 : gateway = JavaGateway() stack = gateway.entry_point.getStack() print(gateway.help(stack)) >>> field section is empty print stack.test1 print stack.test2 print stack.test3 >>> <py4j.java_gateway.JavaMember object at 0x7fd7b1647250> >>> <py4j.java_gateway.JavaMember object at 0x7fd7b1647a10> >>> <py4j.java_gateway.JavaMember object at 0x7fd7b16479d0> Thank you, Wilfried. |