Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

pass Command line arguments as with python interpreter

More
2 years 3 months ago #4170 by Kai
if i do
Code:
argv = sys.argv print(argv)

and call this code with python it works as expected but with netgen argv is empty. How can i pass Command line arguments ?

Thank you :-)
More
2 years 2 months ago - 2 years 2 months ago #4184 by Kai
i have implemented this now as
Code:
argv: list[str] = sys.argv filepath = "" if len(argv) < 2: filepath = os.environ.get("ES_ARGV") else: filepath = argv[1] if __name__ == '__main__' and len(filepath) > 0: mesh = ngsolve.Mesh(filepath)

it seems that netgen does not propagate cmd args to the python interpreter.
Last edit: 2 years 2 months ago by Kai.
Time to create page: 0.176 seconds