Skip to content

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

Open

Description

@ValentinHirschi

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.

Activity

  1. tueda commented on Jul 25, 2022

    @tueda
    Owner

    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 form-dev/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions