diff --git a/.gitignore b/.gitignore index cf4d2c6..5f56985 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /build/ /dist/ /*.egg-info/ +__pycache__ \ No newline at end of file diff --git a/ipyida/kernel.py b/ipyida/kernel.py index 814b191..cacac57 100644 --- a/ipyida/kernel.py +++ b/ipyida/kernel.py @@ -133,8 +133,10 @@ def start(self): # IDAPythonStdOut instance log=logging.getLogger("ipyida_kernel") ) + main_module = sys.modules['__main__'] app.initialize() - + app.kernel.user_module=main_module + app.kernel.user_ns=main_module.__dict__ main = app.kernel.shell._orig_sys_modules_main_mod if main is not None: sys.modules[app.kernel.shell._orig_sys_modules_main_name] = main