[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> Hi
> Iam new in Python.
> I want to know for my first Project in Python how i can get the
> Hostname from a URL?

>>> import urlparse
>>> urlparse.urlsplit('http://foo.bar.com/zapzap')
('http', 'foo.bar.com', '/zapzap', '', '')
>>> 

As you may notice, the hostname is the second item of the tuple result.

> Thanks for Help

You're welcome.


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to