Using Fish Global variable into a Python script

Hello everyone,

Lets suppose that I created a FISH variable called A and stored a value equal to 100 in there. Which in FLAC3D would be written something like [A=100]. Then, would it be possible to use the previous in a Python "if " or “for” routine for further instructions to be made in FLAC3D?, something like this:

if it.command(“[A>100]”):

it.command("model solve")

I’ve tried the above several times and by several ways, however I’ve been able to make it.

Can someone give me a hint on this?

Thank you in advance.

The Python variables and FISH variables are not directedly accessible, from or to. Use to read a FISH variable to Python, or use to set a variable into FISH.


A =‘A’)
if A > 100:
[space] it.command(“model solve”)


Hi Cheng!

I really appreciate your help. At the moment is working pretty well.