turtle dump

Peter Otten __peter__ at web.de
Thu Jul 16 08:46:40 EDT 2009


superpollo wrote:

> alex23 wrote:
>> On Jul 16, 9:18 pm, superpollo <u... at example.net> wrote:
>> 
>>>lol. ;-) the title was indeed supposed to stir a bit of curiosity upon
>>>the reader...
>> 
>> 
>> Which isn't really useful when trying to obtain assistance... you want
>> certainty, not curiosity.
>> 
> 
> ok. my bad.
> 
>> 
>>>in fact i was looking for a *platform independent* way to draw into a
>>>graphics file (say, a postscript or a png) using the turtle module. so i
>>>understand that "dumping a window" is not a good expression... maybe
>>>"redirecting graphics commands to a file instead of a window"?
>> 
>> 
>> You didn't actually answer Diez question. The turtle module is only a
>> recent (2.6/3.0) addition to Python and is probably obscure enough not
>> to have tracked across everyone's radar.
>> 
> 
> actually i am still using 2.3.4, which means that...
> 
>> screen = turtle.Screen()
> 
> ... is not possible

Tested on 2.4:

>>> import turtle
>>> turtle.reset()
>>> for i in range(4):
...     turtle.forward(50)
...     turtle.right(90)
...
>>> turtle._canvas.postscript(file="tmp.ps")
''

I think the big rewrite has happened in 2.6, so the above should also work 
in 2.3.

Peter




More information about the Python-list mailing list