Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package jeptest;
  7.  
  8. import jep.Jep;
  9. import jep.JepException;
  10.  
  11. /**
  12. *
  13. * @author GONTARD Benjamin
  14. */
  15. public class JepTest {
  16.  
  17. /**
  18. * @param args the command line arguments
  19. */
  20. public static void main(String[] args) throws JepException {
  21. // TODO code application logic here
  22. try (Jep jep = new Jep(false)) {
  23. jep.eval("from java.lang import System");
  24. jep.eval("s = 'Hello World'");
  25. jep.eval("System.out.println(s)");
  26. jep.eval("print(s)");
  27. jep.eval("print(s[1:-1])");
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement