answered 9 years ago
Try save method instead of show:
cube((0,0,0),2,('red','green','blue')).save('cube.png')