Using Skulpt and Splinter for Python web application with Turtle?

270 views Asked by At

I'm currently developing a web application where the primary function is Python's Turtle. When I started doing this I used Skulpt to be able to visualize and run my python code on the website, and it worked great. However, I need to give my python code an input from a form in the HTML-file. So I tried using Splinter for that problem, but it did not work, it seems as though the Python code stopped running when I wrote "from splinter import browser".

Does anyone know if Splinter is not compatible with Skulpt or if there is another way I may go about to do this?

1

There are 1 answers

1
Coupido On

splinter is not implemented in skulpt. You can write it yourself. Take a look at "Third Party Modules" on http://www.skulpt.org/

Another way is to change "input()":

Sk.configure({
        inputfun: function (prompt) {
           return window.prompt(prompt);
        },
});

Here is an interesting post about change the input Wait for an event to occur within a function in Javascript for Skulpt