With UNIX shells there are lots of ways to manage this. First you don't
need the "cd .." at all because the working directory is a per-process
feature: changing directories in a sub-shell doesn't impact the parent
shell. I'm aware that Windows may not behave that way.
Also in general for UNIX shell scripts in recipes you want to separate
all the commands with "&&", not ";", which ensures that if one fails the
command fails immediately with that error.
I'm not strong in Windows scripting so I can't say the best way to solve
your problem. Presumably you want to preserve the exit code of the
python script, then do the "cd ..", then exit from the recipe line using
the saved exit code.