467
467
than the URL you pass to .add_password() will also match. ::
469
469
# create a password manager
472
472
# Add the username and password.
474
474
top_level_url = "http://example.com/foo/"
475
475
password_mgr.add_password(None, top_level_url, username, password)
479
479
# create "opener" (OpenerDirector instance)
482
482
# use the opener to fetch a URL
486
486
# Now all calls to urllib2.urlopen use our opener.