Hi all
In the following code extract, "Launch.wait()" generates an error only if it is inserted in a function (it works in the program core); "Launch" variable does not exist outside the function so it remains a local variable.
I would like to understand what I'm missing (
Thanks
In the following code extract, "Launch.wait()" generates an error only if it is inserted in a function (it works in the program core); "Launch" variable does not exist outside the function so it remains a local variable.
I would like to understand what I'm missing (
Thanks
1 2 3 4 |
def RunExe(Path, InputFile): exec ( "Launch = subprocess.Popen(['%s\exe', 'name=%s'])" % (Path, InputFile)) Launch.wait() del Launch |
Error:UnboundLocalError: local variable 'Launch' referenced before assignment