code: def show_image(self, name):
          
          command = "%s.show()" % name
          sw = self.shellwidget
          if sw._reading:
              sw.kernel_client.input(command)
          else:
              sw.execute(command)
docs: Show image (item is a PIL image)