-
Notifications
You must be signed in to change notification settings - Fork 0
/
_jupyter_display.py
51 lines (34 loc) · 1.69 KB
/
_jupyter_display.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Call this file with
# !wget --no-clobber --quiet "https://raw.githubusercontent.com/Mr-Ruben/ml/master/_jupyter_display.py"
# %run _jupyter_display.py
import sys
# Adapted to the differences in library paths from Python 3.7
if sys.version_info.minor<=7:
from IPython.core.interactiveshell import InteractiveShell
else:
from IPython import InteractiveShell
# To print the output of all commands (except those ending in ; )
InteractiveShell.ast_node_interactivity = "all"
# To change the width of the current notebook you're working on,
# you can enter the following into a cell:
if sys.version_info.minor<=7:
from IPython.core.display import display, HTML
else:
from IPython.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
## To print the output of all commands (except those ending in ; )
#from IPython.core.interactiveshell import InteractiveShell
#InteractiveShell.ast_node_interactivity = "all"
## To change the width of the current notebook you're working on, you can enter the following into a cell:
#from IPython.core.display import display, HTML
#display(HTML("<style>.container { width:100% !important; }</style>"))
# ---------------------- v3 ---------------------------
# import sys
# if sys.version_info.minor<=7:
# from IPython.core.interactiveshell import InteractiveShell
# else:
# from IPython.interactiveshell import InteractiveShell
# InteractiveShell.ast_node_interactivity = "all"
# # To change the width of the current notebook you're working on, you can enter the following into a cell:
# from IPython.core.display import display, HTML
# display(HTML("<style>.container { width:100% !important; }</style>"))