Commit 4221253a authored by Florent Chehab's avatar Florent Chehab
Browse files

Update file size optimization

parent d8c0fbb5
......@@ -71,7 +71,7 @@
"import plotly.graph_objs as go\n",
"\n",
"# Some magic for file size optimization\n",
"if is_connected():\n",
"if is_connected(debug=True):\n",
" # do not include plotly js directly\n",
" init_notebook_mode(connected=True) \n",
"else:\n",
......
import socket
def is_connected():
hostname = "www.utc.fr"
def is_connected(debug):
hostname = "www.google.fr"
try:
host = socket.gethostbyname(hostname)
socket.create_connection((host, 80), 2)
s = socket.create_connection((host, 80), 2)
return True
except: # noqa: E722
pass
print("No connection detected")
return False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment