Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
#!/usr/bin/env python import urllib import sys try: url = sys.argv[1] except IndexError: print("Please specify URL") sys.exit(1) usock = urllib.urlopen(url) size = usock.info().get('Content-Length') if size is None: size = 0 size = float(size) / 1024.0 / 1024.0 print("%d MB" % size)
This paste will be private.
From the Design Piracy series on my blog: