- Thank you received: 0
pass Command line arguments as with python interpreter
2 years 10 months ago #4170
by Kai
pass Command line arguments as with python interpreter was created by Kai
if i do
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
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
2 years 9 months ago - 2 years 9 months ago #4184
by Kai
Replied by Kai on topic pass Command line arguments as with python interpreter
i have implemented this now as
it seems that netgen does not propagate cmd args to the python interpreter.
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 9 months ago by Kai.
Time to create page: 0.105 seconds