s = socks.socksocket()
proxy = '217.12.202.120:58793'
proxy_ip,proxy_port = proxy.split(':')
s.set_proxy(socks.SOCKS4,proxy_ip,int(proxy_port))
s.connect(("www.sourceforge.net", 80))
rror: [Errno 9] Bad file descriptor
Find more questions by tags Python