Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: split custom pytorch dataset 
Python :: get the creating date of files ftp python 
Python :: Python __floordiv__ magic method 
Python :: pandas assign value to row based on condition 
Python :: find out length of a string in pixels python 
Python :: reverse string python 
Python :: Python __add__ magic method 
Python :: python defaultdict default value 
Python :: python text recognition 
Python :: how to use mtproto proxy for telethon 
Python :: python selenium element not interactable while headless 
Python :: python meanGroups(a): 
Python :: run a shell script from python 
Python :: python sepia filter 
Python :: pygame image get height 
Python :: python chunk text 
Python :: ord() python 
Python :: django insert data into database foreign key view.py 
Python :: pandas select only columns with na 
Python :: assert in selenium python 
Python :: update matplotlib params 
Python :: permutation and combination in python 
Python :: python infinite l00p 
Python :: set lable of field django 
Python :: python system performance 
Python :: matplotlib yaxis off 
Python :: speech to text function in python 
Python :: keras backend matrix multiplication 
Python :: python indent print 
Python :: foreign key django createview 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =