Skip to content

Instantly share code, notes, and snippets.

View engrhwu's full-sized avatar

engrhwu

View GitHub Profile
@engrhwu
engrhwu / 0_urllib2.py
Created April 13, 2017 10:34 — forked from kennethreitz/0_urllib2.py
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()