Guest User

Untitled

a guest
Nov 17th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. @FXML
  2. private void handleRunButtonAction(ActionEvent event) {
  3. System.out.println("You clicked the button!");
  4. String s = null;
  5. try {
  6. String command = "/home/mehedi python3.6 test.py";
  7. Process p = Runtime.getRuntime().exec(command);
  8.  
  9. BufferedReader stdInput = new BufferedReader(new
  10. InputStreamReader(p.getInputStream()));
  11.  
  12. while ((s = stdInput.readLine()) != null) {
  13. System.out.println(s);
  14. }
  15. }
  16. catch (IOException e) {
  17. System.out.println("exception happened: ");
  18. e.printStackTrace();
  19. System.exit(-1);
  20. }
  21. }
Add Comment
Please, Sign In to add comment