Page 1 of 1

Use of Subprocess.py in macro

PostPosted: Fri Jul 23, 2021 7:16 am
by alban.cotton@se.com
Hello,
I'm trying to use the Subprocess.py lib in a macro but it's not working.

here is an exemple of the code:
Code: Select all

import subprocess

subprocess.run(['print("hello")'],shell=True)             
     

I got this message:
MagicDraw cannot execute the Jython macro, please make sure that the md:\\_19_0_2_e670268_1627040463662_130879_79761 is correct. null java.lang.IncompatibleClassChangeError: java.lang.IncompatibleClassChangeError: Found class com.kenai.jffi.InvocationBuffer, but interface was expected in md:\\_19_0_2_e670268_1627040463662_130879_79761 at line number 2

I tried it on a pyhton IDE it's working
Does anyone know why?

Thank you by advance,
Alban

Re: Use of Subprocess.py in macro

PostPosted: Thu Jul 29, 2021 12:49 am
by charlenecart12@gmail.com
The subprocess module present in Python(both 2. x and 3. x) is used to run new applications or programs through Python code by creating new processes. It also helps to obtain the input/output/error pipes as well as the exit codes of various commands.
Lowes Life

Re: Use of Subprocess.py in macro

PostPosted: Mon Aug 09, 2021 12:36 am
by alban.cotton@se.com
Ok thank you for the precision.
Do you know if there is a way to use it within Cameo ?

Re: Use of Subprocess.py in macro

PostPosted: Tue Sep 07, 2021 5:09 am
by psemenov313@gmail.com
This works really well for us, thank you!

aces etm