Skip to content

Instantly share code, notes, and snippets.

@mkowoods
Last active August 29, 2015 14:08
Show Gist options
  • Save mkowoods/59a2ad1a298e83e03677 to your computer and use it in GitHub Desktop.
Save mkowoods/59a2ad1a298e83e03677 to your computer and use it in GitHub Desktop.
simplehttp server
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: mwoods
#
# Created: 05/11/2014
# Copyright: (c) mwoods 2014
# Licence: <your licence>
#-------------------------------------------------------------------------------
#Simple way to transfer files over a network
#Notes: Run this from the directory where you want to braodcast from
#grab the IP Address of the computer and then navigate to the IP
#on any othe computer in the same network
import SimpleHTTPServer
import SocketServer
import socket
PORT = 8888
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
IP = socket.gethostbyname(socket.gethostname())
print "serving at IP: %s; Port: %s"%(IP, PORT)
print "url: http://%s:%s"%(IP, PORT)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment