shape() method for turtle.py
Love that @olemoritz quietly added a turtle.py module.
Unfortunately turtle.shape() is still on the todo list.
If someone with more skill then me can help me turn the current triangle shape into a little turtle shape it would be magic to my students who are learning python3 on pythonista.
I am guessing the curent turtle shape is drawin in the
pen_tip = ui.path
Would it be as simple as painstakingly drawing a ui.path outline of a turtle shape to change the default triangle?
here is a little modification -- i used the shapes from cpython's turtle.py (though had to rotate the view another 90 deg, due to way pythonista's conevtion works). I modified PenView to have a settable shape.
import turtle2 turtle=turtle2.Turtle() turtle.color("blue","") turtle.pendown() for s in turtle2._pen_view._shapes: turtle.shape(s) turtle.forward(100) turtle.right(100)
Thanks for a quick reply. Let me take a look at this. I am really grateful.
@JonB this works beautifully. I now have little turtles all over my screen. You should share this with @olemoritz incase he feels like adding it to the turtle module in Pythonista.
Seriously, thank you.
+1 for more shapes :). Will look into option of getting the turtle2 lib installed on the class iPads. Perhaps I could have a one liner that references an icloud based lib, so updates can be shared easily between devices...
- Yehuda Katz
Hi Farmer,
Perhaps the following code might help (the dots before 'shape' represent spaces):
from turtle import * ht(); pu() for i in(getshapes()): ....shape(i); stamp(); fd(43) goto(0, -30) write(getshapes()) done()