Page 1 of 1

turtle

PostPosted: Thu Sep 11, 2014 7:19 pm
by kw123
can I use python turtle in indigo?

in idle it works, when I open a scripting shell window within indigo
import turtle
def draw_square():
window = turtle.Screen()

it complains that
'module' object has no attribute 'Screen'

How do I add the Screen method to indigo? Do I need to import another library?

thx

Karl

Re: turtle

PostPosted: Thu Sep 11, 2014 7:31 pm
by FlyingDiver
What are you trying to draw to? Indigo Server has no UI so there's no "window" to draw to.

Re: turtle

PostPosted: Thu Sep 11, 2014 7:54 pm
by kw123
know that,... essentially would like to create dynamically png files using a graphics package that runs under py 2.5

get the same error in a regular terminal / py session, has nothing to do with indigo I guess.

Re: turtle

PostPosted: Thu Sep 11, 2014 8:08 pm
by FlyingDiver

Re: turtle

PostPosted: Thu Sep 11, 2014 8:13 pm
by matt (support)
I'm not sure if it is possible to get it working, but it definitely is failing because of python 2.5. If you try it from Terminal after launching "python2.5" then it fails in the same manner as from Indigo's scripting shell.

Re: turtle

PostPosted: Thu Sep 11, 2014 8:17 pm
by FlyingDiver
I think the Turtle library assumes an interactive session, like IDLE. Using a straight drawing package would be better.

Re: turtle

PostPosted: Thu Sep 11, 2014 9:47 pm
by kw123
installed cairo (after many trials with home-brew.) now have to make py recognize it.

Re: turtle

PostPosted: Thu Sep 11, 2014 10:01 pm
by kw123
pycairo:
Dependencies
------------
cairo >= 1.8.8
Python >= 2.6

no luck with py 2.5