Created
August 30, 2017 07:48
-
-
Save thinkycx/0b1d2619e80d99d8799b8a047adc77da to your computer and use it in GitHub Desktop.
python ftp 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
import SimpleHTTPServer | |
import SocketServer | |
import socket | |
hostname = socket.gethostname() | |
ip = socket.gethostbyname(hostname) | |
ipList = socket.gethostbyname_ex(hostname) | |
PORT = 8001 | |
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler | |
httpd = SocketServer.TCPServer(("", PORT), Handler) | |
print "serving at %s:%s" % (str(ipList[2][3]),str(PORT)) | |
httpd.serve_forever() | |
raw_input() | |
#python -m SimpleHTTPServer 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment