Execute the script in command line or in Rest client
Try both things but try to execute in command line to know the output line by line. 
you can find any error in the line when that line will execute 
while at rest service it will return you an Http response.
I have a java web application that needs to make use of a python script. The web application will give the script a file as input and take some text as output. 
I have two options:

Wrap the python script with HTTP and call it from the web application as a REST service
Simply execute command line from the web application

Which option should I take and why? This script won't be used by any other application.