Skip to content
Discussion options

You must be logged in to vote

as I get the error ' The method get(int) is undefined for the type Attempt'

As described here, you need to convert the Attempt object to a Java type by passing what class you want to convert it to (and you can use the 'shortcut' described in the linked-page to do this in one call).

Also, using get(1) will return the value at index 1 (i.e., 5). If you want the reverse, you can use indexOf. For example:

pyCommunicator.run("sequence = [2,5,3,6,4,1]");
ArrayList<Integer> seq = pyCommunicator.runResults(ArrayList.class, "sequence");
traceln(seq.get(1)); // prints 5
traceln(seq.indexOf(5)); // prints 1

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MarloesAlb
Comment options

Answer selected by t-wolfeadam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants