Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Access python http.server on google colab

from IPython.display import Javascript

def show_port(port, height=400):
  display(Javascript("""
  (async ()=>{
    fm = document.createElement('iframe')
    fm.src = await google.colab.kernel.proxyPort(%s)
    fm.width = '95%%'
    fm.height = '%d'
    fm.frameBorder = 0
    document.body.append(fm)
  })();
  """ % (port, height) ))
  
get_ipython().system_raw('python3 -m http.server 8888 &') 
show_port(8888)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Access #python #google #colab
ADD COMMENT
Topic
Name
4+5 =