+ 2

GUI-Based Python code in Webpage

I have the following Python code: https://sololearn.com/compiler-playground/cI8u3i2b4z9V/?ref=app And I want to run it in a webpage. Do note that it uses GUI graphics. I tried and barely got Pyscript running, then looked into other ones, but the GUI graphics from turtle isn't supported in any of the JavaScript libraries for running Python which I found(Brython, Pyodide). Is it possible to implement the code in my webpage, and if it is, how so?

5th Jul 2025, 2:06 PM
Afnan Irtesum Chowdhury
Afnan Irtesum Chowdhury - avatar
3 ответов
+ 2
Afnan Irtesum Chowdhury Yes, you can run your code in web compiler using skulpt. Here is a example of how can you use turtle in your webpage: https://sololearn.com/compiler-playground/W4gB8gfenNFH/?ref=app Skulpt doesn't support all python standard library modules and unfortunately colorsys isn't available in Skulpt's supported built-ins. To solve the issue, you can manually re-implement colorsys functions in Python.
5th Jul 2025, 2:12 PM
Gulshan Mahawar
Gulshan Mahawar - avatar
+ 1
Gulshan Mahawar I modified the code, but the canvas stays pitch black(empty), no changes happen EDIT: Got it to work, but can't change the color(all stars are red). Need some help... https://sololearn.com/compiler-playground/WYhf79dzRRiP/?ref=app
5th Jul 2025, 2:37 PM
Afnan Irtesum Chowdhury
Afnan Irtesum Chowdhury - avatar
0
Afnan Irtesum Chowdhury Try this: `print(h) print(r,g,b) ` I found that h is getting modified in the loop but r,g,b isn't changing. That's pretty weird.
5th Jul 2025, 3:33 PM
Gulshan Mahawar
Gulshan Mahawar - avatar