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
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