Groups
Groups
Sign in
Groups
Groups
Py4J Support and Comments
Conversations
About
Send feedback
Help
how to call a java method which the method name is a keyword in python
19 views
Skip to first unread message
Ranger Tsao
unread,
Dec 9, 2016, 1:36:33 AM
12/9/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Py4J Support and Comments
eg:
public class Test{
public void and(){
//do something
}
}
how to call this method in python?
thanks all
Jonah Graham
unread,
Dec 9, 2016, 1:43:55 AM
12/9/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ranger Tsao, Py4J Support and Comments
Hi,
Instead of doing this which is the problem:
test_instance.and()
do this:
getattr(test_instance, "and")()
https://docs.python.org/3.6/library/functions.html#getattr
HTH
Jonah
~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com
> --
> You received this message because you are subscribed to the Google Groups
> "Py4J Support and Comments" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
py4j+uns...@py4j.org
.
> To post to this group, send email to
py...@py4j.org
.
> To view this discussion on the web visit
>
https://groups.google.com/a/py4j.org/d/msgid/py4j/23ea4246-3bc7-4db3-960d-1fe075b13952%40py4j.org
.
Ranger Tsao
unread,
Dec 10, 2016, 8:12:01 AM
12/10/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Py4J Support and Comments
Thanks you!!! I will have a try
在 2016年12月9日星期五 UTC+8下午2:43:55,Jonah Graham写道:
Reply all
Reply to author
Forward
0 new messages