I have been trying to access to Microsoft Print 3D from python using "subprocess" package.
What I want to do is to open a set of (.stl) files in the app and extract some information from each of them.
#Path of the program
MS_Print_3D = '... /Applications (Parallels)/{c2916d26-d1f5-414d-b261-d6c91024400d} Applications.localized//Print 3D.app'
#STL 3D file
stl_file = '.../994012.stl'
I got to open and run the program with a selected (.stl) file. However, I do not know how to access to the attributes or the information that are plotted inside the app.
p_run = subprocess.run(["open", "-n", MS_Print_3D, stl_file],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=True,
text=True,
)
I used stdout to see if there may be an output. However what I really want to know is if I can access to the information inside the application, software or program I am opening with subprocess.
I just want to know if it may be possible, or if I should use another method.
print('Standard Output:', p_run.stdout)
print('-------------')
print('Standard Error:', p_run.stderr)
print('-------------')
print('Arguments:', p_run.args)
print('-------------')
print('Return Code:', p_run.returncode)
print('-------------')
print('Check Return Code:', p_run.check_returncode)
print('-------------')
Standard Output:
-------------
Standard Error:
-------------
Arguments: ['open', '-n', '.../Applications (Parallels)/{c2916d26-d1f5-414d-b261-d6c91024400d} Applications.localized//Print 3D.app', '.../994012.stl']
-------------
Return Code: 0
-------------
Check Return Code: <bound method CompletedProcess.check_returncode of CompletedProcess(args=['open', '-n', '... Applications (Parallels)/{c2916d26-d1f5-414d-b261-d6c91024400d} Applications.localized//Print 3D.app', '...//994012.stl'], returncode=0, stdout='', stderr='')>
-------------