I have been using IronPython libraries in C# to alter the values in the python script beforehand before running the python script. I do not want the engine to execute the python code before C# has taken the variables from the python script and manipulated them before putting the new values into the python script variables. I like the getvariable method except for the fact that it seems like it needs the engine to execute first before being able to obtain the variables. Any ideas?
Here's what I would be doing in this case (of course if possible). You could create a JSON File (or any other medium) in C# with all the variables you want to have changed and then just read it at the beginning of your python script.
If that does not work for you, can you maybe elaborate on why you want to change the variables in a python script before running it?
Sidenote: I looked into IronPython for myself and decided to leave my fingers from it as much as possible. At least for my purposes it often does not support the libraries I am interested in and does not seem like there will be support coming anytime soon as it rarely gets significant updates and seems to be dying out. (Microsoft gave up its support quite a long time ago already)
Is there a way to get C# to get and set variables from a python script without executing it beforehand?