Created
June 29, 2011 03:05
-
-
Save Senix/1052889 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| #Download all sluggy freelance images | |
| import urllib | |
| mage = int(raw_input('image to download: ')) | |
| mage += 1 | |
| lett = 'a' | |
| imagetype = '.gif' | |
| filename = "%s%s.gif" % (mage, lett) | |
| f = urllib.urlopen('http://www.sluggy.com/images/comics/'+filename+lett+imagetype) | |
| f = urllib.urlretrieve('http://www.sluggy.com/images/comics/'+filename+lett+imagetype) | |
| open(filename, 'w').write(filename.read()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image to download: 110620 | |
| Traceback (most recent call last): | |
| File "/home/look/workspace/slug_lancer/src/down.py", line 14, in <module> | |
| open(filename, 'w').write(filename.read()) | |
| AttributeError: 'str' object has no attribute 'read' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment