Updated python engine class to automatically initialize the global scope