Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @FXML
- private void handleRunButtonAction(ActionEvent event) {
- System.out.println("You clicked the button!");
- String s = null;
- try {
- String command = "/home/mehedi python3.6 test.py";
- Process p = Runtime.getRuntime().exec(command);
- BufferedReader stdInput = new BufferedReader(new
- InputStreamReader(p.getInputStream()));
- while ((s = stdInput.readLine()) != null) {
- System.out.println(s);
- }
- }
- catch (IOException e) {
- System.out.println("exception happened: ");
- e.printStackTrace();
- System.exit(-1);
- }
- }
Add Comment
Please, Sign In to add comment