Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficult to specify environment variables for a python-form session. #3

Open
ValentinHirschi opened this issue Jul 20, 2022 · 1 comment

Comments

@ValentinHirschi
Copy link

When running a FORM code with python-form that has such a pragma e.g.:

#: MaxTermsize 1M

Then it is not interpreted correctly, in the sense that it is not updating that environment value for FORM when executing the code.
This is likely because a FORM session/kernel has already been started by then and it cannot update this option afterwards.
But then, what would be nice is to be able to update these FORM environment variables as options to the open(...) function.

For now I can make sure to specify the path of my FORM interpreter to one where I have an appropriate form.set file, but it'd be more convenient to be able to supply this with python options as I suggested.

@tueda
Copy link
Owner

tueda commented Jul 25, 2022

Thank you for your suggestion. To do this, init.frm must be temporarily copied to somewhere and dynamically rewritten in such a way that such options are supplied to the input file, which is passed to FORM here.

Or, for now, maybe you can just set form.FormLink._INIT_FRM to your favorite file, which should contain the structure similar to init.frm in order to handle pipes. Including (= #include) the file of the original form.FormLink._INIT_FRM may work (I haven't tested).

By the way, the necessity of init.frm in the startup is the reason why I made vermaseren/form#265. Using stdin for the input can give more flexibility to this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants