Hey. "import os" after the offending line won't work because the symbol (os) is imported as local to the method. A quick workaround would be to add "global os" at the beginning of the RURApp.init, and then "import os" after "win = py.shell ...".

That way, the reimported module will be assigned a global label.