In [20]:
import urllib
for i1 in range(2):#
    for j1 in range(4):
        for i2 in range(4):
            for j2 in range(4):
                for k2 in range(4):
                    for i3 in range(4):
                        for j3 in range(4):
                            for k3 in range(4):
                                for i4 in range(4):
                                    URL = "http://tile156.gigapan.org/gigapans0/156863/tiles.95657712256da7a69eb74b3984afb165/r"+\
                                        repr(i1)+repr(j1)+"/"+repr(i2)+repr(j2)+repr(k2)+"/"+repr(i3)+repr(j3)+repr(k3)+"/r"+\
                                        repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg"
                                    try: file("gp/"+repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg",'r').read()
                                    except: urllib.urlretrieve(URL, "gp/"+repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg")
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-20-430a15fd12c2> in <module>()
     11                                     URL = "http://tile156.gigapan.org/gigapans0/156863/tiles.95657712256da7a69eb74b3984afb165/r"+                                        repr(i1)+repr(j1)+"/"+repr(i2)+repr(j2)+repr(k2)+"/"+repr(i3)+repr(j3)+repr(k3)+"/r"+                                        repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg"
     12                                     try: file("gp/"+repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg",'r').read()
---> 13                                     except: urllib.urlretrieve(URL, "gp/"+repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg")

C:\Anaconda\lib\urllib.pyc in urlretrieve(url, filename, reporthook, data)
     92     if not _urlopener:
     93         _urlopener = FancyURLopener()
---> 94     return _urlopener.retrieve(url, filename, reporthook, data)
     95 def urlcleanup():
     96     if _urlopener:

C:\Anaconda\lib\urllib.pyc in retrieve(self, url, filename, reporthook, data)
    238             except IOError:
    239                 pass
--> 240         fp = self.open(url, data)
    241         try:
    242             headers = fp.info()

C:\Anaconda\lib\urllib.pyc in open(self, fullurl, data)
    206         try:
    207             if data is None:
--> 208                 return getattr(self, name)(url)
    209             else:
    210                 return getattr(self, name)(url, data)

C:\Anaconda\lib\urllib.pyc in open_http(self, url, data)
    343         if realhost: h.putheader('Host', realhost)
    344         for args in self.addheaders: h.putheader(*args)
--> 345         h.endheaders(data)
    346         errcode, errmsg, headers = h.getreply()
    347         fp = h.getfile()

C:\Anaconda\lib\httplib.pyc in endheaders(self, message_body)
    989         else:
    990             raise CannotSendHeader()
--> 991         self._send_output(message_body)
    992 
    993     def request(self, method, url, body=None, headers={}):

C:\Anaconda\lib\httplib.pyc in _send_output(self, message_body)
    842             msg += message_body
    843             message_body = None
--> 844         self.send(msg)
    845         if message_body is not None:
    846             #message_body was not a string (i.e. it is a file) and

C:\Anaconda\lib\httplib.pyc in send(self, data)
    804         if self.sock is None:
    805             if self.auto_open:
--> 806                 self.connect()
    807             else:
    808                 raise NotConnected()

C:\Anaconda\lib\httplib.pyc in connect(self)
    785         """Connect to the host and port specified in __init__."""
    786         self.sock = self._create_connection((self.host,self.port),
--> 787                                            self.timeout, self.source_address)
    788 
    789         if self._tunnel_host:

C:\Anaconda\lib\socket.pyc in create_connection(address, timeout, source_address)
    569 
    570     if err is not None:
--> 571         raise err
    572     else:
    573         raise error("getaddrinfo returns an empty list")

IOError: [Errno socket error] [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
In [18]:
import urllib
for i1 in range(2):#
    for j1 in range(4):
        for i2 in range(4):
            for j2 in range(4):
                for k2 in range(4):
                    #for i3 in range(4):
                    #    for j3 in range(4):
                    #        for k3 in range(4):
                                for i4 in range(4):
                                    URL = "http://tile156.gigapan.org/gigapans0/156863/tiles.95657712256da7a69eb74b3984afb165/r"+\
                                        repr(i1)+repr(j1)+"/"+repr(i2)+repr(j2)+repr(k2)+"/r"+\
                                        repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i4)+".jpg"
                                    try: file("gp2/"+repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i4)+".jpg",'r').read()
                                    except: urllib.urlretrieve(URL, "gp2/"+repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i4)+".jpg")
In [ ]:
import urllib
for i1 in range(2):#
    for j1 in range(4):
        for i2 in range(4):
            for j2 in range(4):
                for k2 in range(4):
                    for i3 in range(4):
                        for j3 in range(4):
                            for k3 in range(4):
                                for i4 in range(4):
                                    URL = "http://tile156.gigapan.org/gigapans0/156863/tiles.95657712256da7a69eb74b3984afb165/r"+\
                                        repr(i1)+repr(j1)+"/"+repr(i2)+repr(j2)+repr(k2)+"/"+repr(i3)+repr(j3)+repr(k3)+"/r"+\
                                        repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg"
                                    try: file("gp3/"+repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg",'r').read()
                                    except: urllib.urlretrieve(URL, "gp3/"+repr(i1)+repr(j1)+repr(i2)+repr(j2)+repr(k2)+repr(i3)+repr(j3)+repr(k3)+repr(i4)+".jpg")
In [15]:
URL
Out[15]:
'http://tile156.gigapan.org/gigapans0/156863/tiles.95657712256da7a69eb74b3984afb165/r10/201/r102013.jpg'