This docs on this page refers to a PREVIOUS VERSION. For the latest stable release, go to https://docs.bokeh.org/

Archived docs for versions <= 1.0.4 have had to be modified from their original published configuration, and may be missing some features (e.g. source listing)

All users are encourage to update to version 1.1 or later, as soon as they are able.

bokeh.util.platform — Bokeh 0.12.5 documentation

Source code for bokeh.util.platform

""" Functions for testing what kind of Python or Python environment is in use.

"""

[docs]def is_py3(): """ Test whether we are running Python 3. Returns True if we are running Python 3, otherwise False """ import sys return sys.version_info[0] == 3
[docs]def is_pypy(): """ Test whether we are running PyPy. Returns True if we are inside PyPy, otherwise False """ import platform return platform.python_implementation() == "PyPy"
[docs]def is_notebook(): """ Test whether we are inside an IPython notebook. Returns True if we are inside a notebook, otherwise False """ try: get_ipython() return True except NameError: return False