import http.server
import socketserver
Handler = http.server.SimpleHTTPRequestHandler


class MyTCPServer(socketserver.TCPServer):
    allow_reuse_address = True
server = MyTCPServer(('0.0.0.0', 8080), Handler)
server.serve_forever()
A simple python server using SimpleHTTPServer and SocketServer, how do I close the socket down before rerunning .py file?