LoginSignup
0
1

More than 5 years have passed since last update.

めざせpythonライブラリマスター (37)slimurl

Posted at

【ライブラリ説明】

 URL解析ができる

【プログラム】

slimurl.py
# -*- coding: utf-8 -*-

from slimurl import URL

url = URL('http://example.net')
print ("%r" % url)
# <URL "http://example.net/">

print ((url.host, url.port, url.scheme))
# ('example.net', 80, 'http')

print (URL('http://example.net') == URL('http://example.net/'))
# True

print (URL('http://example.net:80') == URL('http://example.net/'))
# True

print (URL('http://example.net') == URL('http://example.net/?foo=bar'))
# False

【参考サイト】

 pypi

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1