here is the code, some of it have been converted, so like it is not it will not run on ether one.
I think this part is the problem:
I been looking for a place that show the 2.7 commands = the 3.5, I have not found any thing like that yet.
What way is the best to convert the code?

I try to edit this but could find a way.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import socket #for sockets import sys #for exit try : #create an AF_INET, STREAM socket (TCP) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) except socket.error as msg: print ( 'Failed to create socket. Error code: {}' . format ( str (msg))) sys.exit() print ( 'Socket Created' ) host = 'www.google.com' port = 80 try : remote_ip = socket.gethostbyname( host ) except socket.gaierror: #could not resolve print ( 'Hostname could not be resolved. Exiting' ) sys.exit() print ( 'Ip address of ' ) + host + ' is ' + remote_ip #Connect to remote server s.connect((remote_ip , port)) print ( 'Socket Connected to ' ) + host + ' on ip ' + remote_ip |
1 2 3 4 5 6 |
print ( 'Ip address of ' ) + host + ' is ' + remote_ip #Connect to remote server s.connect((remote_ip , port)) print ( 'Socket Connected to ' ) + host + ' on ip ' + remote_ip |
What way is the best to convert the code?

I try to edit this but could find a way.