Turtle and drawing tree with RapydScript
<p>today I want draw a tree in browser with RapydScript.
I have code in Python:</p>

<pre><code>import random
import turtle

def tree(size, myTurtle):
    myTurtle.pensize(size / 20)

    if size &lt; random.randint(1,2) * 20:
        myTurtle.color("green")
    else:
        myTurtle.color("brown")

    if size &gt; 5:
        myTurtle.forward(size)
        myTurtle.left(25)
        tree(size - random.randint(10, 20), myTurtle)
        myTurtle.right(50)
        tree(size - random.randint(10, 20), myTurtle)
        myTurtle.left(25)
        myTurtle.penup()
        myTurtle.backward(size)
        myTurtle.pendown()

window = turtle.Screen()
window.setup(800,600)
window.bgcolor("white")

myTurtle = turtle.Turtle()
myTurtle.color("brown", "blue")
myTurtle.left(90)
myTurtle.speed(0)
myTurtle.penup()
myTurtle.setpos(0, -250)
myTurtle.pendown()
</code></pre>

<p>And I want to run it in browser to get this effect:</p>

<p><a href="http://i.stack.imgur.com/NpcHB.png" rel="nofollow"><img src="http://i.stack.imgur.com/NpcHB.png" alt="image"></a>
âDon't worry about text over the tree, is in polish ;) I run this in Skulpt, maybe you hear about it, effect you have above.
Now I want to run this in RapydScript and compare it to Skulpt and Brython.</p>

<p>I am wonder if it possible in RapydScript beacuse this code use turtle module.
I guess that I need to change this code somehow to run it on RapydScript. 
Did RapydScript allow to import turtle module?</p>

<p>As you can see here:
<a href="http://www.transcrypt.org/live/turtle_site/turtle_site.html" rel="nofollow">http://www.transcrypt.org/live/turtle_site/turtle_site.html</a></p>

<p>Transcrypt(similiar tool to RapydScript) somehow can draw with turtle.</p>

<p>Can you help me with this?</p>

<p>Of course I want use Python, I know that RapydScript allows to use JavaScript, but I want Python :))</p>

<p>See <code>src/lib</code> in <a href="https://github.com/atsepkov/RapydScript" rel="nofollow">RapydScript repo</a> - there is no <code>turtle</code> module. And it can't import turtle module from Python because it doesn't draw on canvas in browser. So you can't draw tree if you doesn't create turtle module.</p>

python browser turtle-graphics rapydscript