title: I am downloading a file using Python urllib2. How do I check how large the file size is?
body: <p>And if it is large...then stop the download?
  I don't want to download files that are larger than 12MB.</p>
  
  <pre><code>request = urllib2.Request(ep_url)
  request.add_header('User-Agent',random.choice(agents))
  thefile = urllib2.urlopen(request).read()
  </code></pre>