import socket
s = socket.socket()
host = socket.gethostname() port = 9009 s.bind((host,port)) print('This host/server ID is: ', host) print('\n',host,'has been binded to',port) print('\nServer is listening for incoming connections') s.listen(1) conn, addr = s.accept() print(addr,'has successfully connected to Server') while True: sendCommand = input('Server >>> ') if sendCommand == 'Get_Current_working_Directory': conn.send(sendCommand.encode()) receivedCommand = conn.recv(1024) receivedCommand = receivedCommand.decode() print('\nFrom Client >>> ',receivedCommand)