urllib and httplib wan to use my modem instead of the ethernet

Alex amurphy at megapathdsl.net
Sat Dec 8 20:12:10 EST 2001


I am just learning python and have been playing with urllib and
httplib.
 
I have used the sample code on the python.org page but I had a problem
because python insists to dial out with __my modem_ to get the url
address resolved.  I am also connected directly to the internet via
DSL - Ethernet connection - but Python doesn't want to try that
connection which is on all the time. ( I have deleted all modem
connection icons so now it doesn't try to call with the modem but it
still can not fine the internet to resolve the IP address of the URL
target)
 
do I have to configure python to use that ethernet interface card
somehow?
 
in a previous posting, someone answered another newbie question with
the snippet below. This code also fails for me (results in the
"except" condition)
 
import urllib
url="http:\\www.org.python\index.htm"

try:
    f = urllib.urlopen(url)
    print f.read()
except IOError:
    print "Could not open " + url

with the httplib sample code off of the pytho.org site it also fails
with an IOERRO message error 7 'getaddrinfo failed' message - I  think
this is because Python can't find the internet connection on my Windo$
box.
 
Any help much appreciated.
best regards and thanks for any help you might be willing to give,

Alex



More information about the Python-list mailing list