Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Given Tasks:
- I.) Connects to a network service
- II.) Asks for version information
- III.) Receives the response
- IV.) Disconnects
- V.) Prints the response.
- """
- #________________________________________________________Script____________________________
- print("\n\n")
- import socket
- def main():
- host = '##.###.##.###'
- port = ####
- s = socket.socket()
- s.connect((host, port))
- data = s.recv(1024)
- print('Received from server: ' + str(data))
- print('\n')
- message = input("String Code: ")
- s.send(b'message')
- data = s.recv(1024)
- print('Received from server: ' + str(data))
- s.close()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement