I'm somewhat of a n00b to Python and I'm working on a tiny project. This is my code in src/sock.py
import socket
import config
class Server(socket.socket):
def __init__(self):
socket.socket.__init__(self, socket.AF_INET, socket.SOCK_STREAM)
def start(self):
self.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.bind((config.bind_host, config.bind_port))
self.listen(5)
while True:
pass
and my code in start.py
import src
Socket = src.sock
Socket.Server()
Socket.Server.start
but the Server doesn't seem to be starting. :(
Any help would be much appreciated