Jul-27-2017, 10:40 PM
I have java class "Test" that returns 2 lines of string output like this:
18 0
1 1 0 0
when i call the java class with python and have python return the output, it returns it like this:
b'18 0\r\n1 1 0 0'
the python 'test_function' function is doing something like this:
process = Popen(['java', 'Test', '-f=' + file], stdout=PIPE)
(stdout, stderr) = process.communicate()
return stdout.strip()
and the main process is calling 'test_function' like this:
print(test_function(arguments))
this is latest version of python...
any ideas how to fix it to where python returns output in same format as java (ie new lines instead of \r \n etc...)
18 0
1 1 0 0
when i call the java class with python and have python return the output, it returns it like this:
b'18 0\r\n1 1 0 0'
the python 'test_function' function is doing something like this:
process = Popen(['java', 'Test', '-f=' + file], stdout=PIPE)
(stdout, stderr) = process.communicate()
return stdout.strip()
and the main process is calling 'test_function' like this:
print(test_function(arguments))
this is latest version of python...
any ideas how to fix it to where python returns output in same format as java (ie new lines instead of \r \n etc...)