Last active
August 29, 2015 14:08
-
-
Save mkowoods/59a2ad1a298e83e03677 to your computer and use it in GitHub Desktop.
simplehttp server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------- | |
# 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