This works great in 2.7, does not work in 3.5. I hope some one can tell me why?
Line 7 is the problem I think
Thank you
1 2 3 4 5 6 7 8 9 10 11 |
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, msg: print ( 'Failed to create socket. Error code: ' ) + str (msg[ 0 ]) + ' , Error message : ' + msg[ 1 ] sys.exit(); print ( 'Socket Created' ) |
Thank you