Saturday, March 21, 2020

qpython ::make a http server in your phone with python

here is the qpython3 script to run a simple HTTP server in your device..
put a file of name index.html in same directory in which this script is placed and run...and lo..server is running on local host..port 8080 http://localhost:8080
server.py


import http.server
import socketserver
PORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
    print("serving at port", PORT)
    httpd.serve_forever()



No comments:

Implement stsStr Leetcode solution

  28.   Implement strStr() Easy Implement  strStr() . Given two strings  needle  and  haystack , return the index of the first occurrence of...