[Thread Prev][Thread Next][Index]

Re: [ferret_users] running ferret.jnl script in python



Dear Ranjan,

On Mon, Oct 17, 2022 at 4:44 PM Ranjan Kumar Sahu <ranzan998@xxxxxxxxx> wrote:
dear ferrters,
So, I am using python. There is a ferret.jnl script that needs to be run inside a python script.
you may ask, why?  The answer is, file handing(i.e, data variables and attributes ) is quite good in ferret, while python has its own upsides.
If there is any such way to do that, I would be glad to hear about it.

I'm sure there are a lot of more knowledgeable people about python than me, but . . . 

First of all, I'll assume you can run your ferret script, ferret.jnl, on the terminal (command line) as

pyferret -script ferret.jnl

Then, from within your python program, you do the same:

os.system("pyferret -script ferret.jnl")

or

import subprocess
subprocess.run(["pyferret", "-script", "ferret.jnl"])

See

https
[Thread Prev][Thread Next][Index]