[SciPy-user] How to save image from a window

Lorenzo Isella lorenzo.isella@gmail....
Thu Apr 17 04:33:01 CDT 2008

Dear All,
I have already posted this to the visual python mailing list, but with 
no success.
The problem is the following: I want to make a movie using Python tools.
The short script I paste below (it needs visual python) plots a chain of 
spheres in a window.
How can I automatically save the window into e.g. a jpeg file?
I need automation because I aim at generating O(100) jpeg files for my 
I was suggested to use the PIL (python image library) and the ImageGrab 
module, but this seems to be available for Windows only.
Any suggestion?

Here is the code:

#! /usr/bin/env python

import scipy as s
import numpy as n
import pylab as p

import visual as v



               for loc in zip(x_list,y_list,z_list)]   

Now you should see a window with a line of spheres.
How would you save that to a file (without e.g. using Gimp and clicking 
here and there)?
In case it matters, I am running Debian testing on my box.
Many thanks


More information about the SciPy-user mailing list