Python Image Grabber
Pigpy the creative commons mascot!

Python Image Grabber

Python Image Grabber or is a very simple python command line tool to download all the images from a given uri.


Download and Installation:


python Example: python

Open Source: has been placed in the public domain and its sourcecode may be viewed or branched here here:

Pigpy Gimp Project


2 thoughts on “Python Image Grabber

  1. You’re a python ninja. Here’s my favorite line:

    filename = img_uri.split(‘/’)[-1]

    It intrigues me. With the perl background I’m familiar with the whole split routine…but the [-1]… -1 from what? It’s a nice magic :)

    1. In python when you string split() a list (sometimes referred to as array in other languages) is returned. From that list I’m asking for the last index.


      # a string
      img_uri = “”

      # a list of strings
      img_uri_parts = img_uri.split(‘/’)

      print img_uri_parts
      # >>> [‘’, ‘attachments’, ‘pic1.jpg’]

      # I want the filename, last part of the uri
      # In this case img_uri[2]
      # This will not always be true.
      # I always need the last element of the list.

      print img_uri_parts[-1]
      # >>> ‘pic1.jpg’

      For more information take a look at this page:

Leave a Reply

Your email address will not be published. Required fields are marked *