diff --git a/jupyter_client/launcher.py b/jupyter_client/launcher.py index 285778a68..33f35a7c7 100644 --- a/jupyter_client/launcher.py +++ b/jupyter_client/launcher.py @@ -111,6 +111,10 @@ def launch_kernel(cmd, stdin=None, stdout=None, stderr=None, env=None, DUPLICATE_SAME_ACCESS) env['JPY_PARENT_PID'] = str(int(handle)) + # Prevent creating new console window on pythonw + if redirect_out: + kwargs['creationflags'] = kwargs.setdefault('creationflags', 0) | 0x08000000 # CREATE_NO_WINDOW + else: # Create a new session. # This makes it easier to interrupt the kernel,