From 27e653315b7c5544da36d8b8f46cd02550b81e41 Mon Sep 17 00:00:00 2001 From: eendebakpt Date: Mon, 9 May 2016 13:46:37 +0200 Subject: [PATCH 1/2] improve documentation of notebook detection function --- qcodes/utils/helpers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qcodes/utils/helpers.py b/qcodes/utils/helpers.py index bcad2bbae92f..29fc1c819fa0 100644 --- a/qcodes/utils/helpers.py +++ b/qcodes/utils/helpers.py @@ -9,9 +9,14 @@ import multiprocessing as mp +def is_interactive(): + import __main__ as main + return not hasattr(main, '__file__') + def in_notebook(): ''' - is this code in a process directly connected to a jupyter notebook? + Returns True if the code is running with a ipython or jypyter + This could mean we are connected to a notebook, but this is not guaranteed. see: http://stackoverflow.com/questions/15411967 ''' return 'ipy' in repr(sys.stdout) From 5bbdceb8fcab8e7d4072f4528eabd68ad865c21a Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Tue, 10 May 2016 12:04:20 +0200 Subject: [PATCH 2/2] remove function (will be moved to other PR) --- qcodes/utils/helpers.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qcodes/utils/helpers.py b/qcodes/utils/helpers.py index 29fc1c819fa0..699fd12a3932 100644 --- a/qcodes/utils/helpers.py +++ b/qcodes/utils/helpers.py @@ -9,10 +9,6 @@ import multiprocessing as mp -def is_interactive(): - import __main__ as main - return not hasattr(main, '__file__') - def in_notebook(): ''' Returns True if the code is running with a ipython or jypyter