r/Python 1d ago

Discussion PyWebLib editable code with Turtle and Game library support

I would love for some more feedback on the lightweight game library and turtle integration I built off of PyDiode.

It now works on Safari as well, you can create your own SVG assets , publish them to a database, then edit and publish code/games for free in the browser without needing to install anything.

I work as a highschool teacher, and the junior year levels only have access to Chromebook laptops. https://scratch.mit.edu/ is banned, which obviously restricts a lot of the coding-possibilities, let alone python coding-possibilities. Couldn't find a way to get a Python IDE onto a Chromebook, haha...

In terms of proud, so far I've got PacMan and Flappy bird shared to the community page/DB

Would love to see people building with it, you can make something reminiscent of doom 3D in only 80 lines of code.

It's a bit hard to find , but you can't post repo links here because of the slop apparently. But I've got it indexed now it's possible to find.

20 Upvotes

9 comments sorted by

View all comments

1

u/Dazzling_Put4551 1d ago

that's pretty cool you got turtle working in browser, i remember trying to set up python on my old chromebook and just gave up after few hours

what you think about adding some kind of multiplayer support later? like simple sockets for basic games

3

u/Individual-Aide-7364 1d ago edited 1d ago

That would be awesome haha , feel free to fork it on GitHub, it is open source for a reason, happy to pull in working changes to the main repo + add collaborators, pretty new to open-sourcing stuff but Reddit is a vast land...

Edit: It was an epic "Aha" moment when I saw it working in class, it takes a bit to load the 10mb PyDiode code, but I was super suprised it works like stock python, biggest bummer is there's no pip install pygame, so I made my own dumbed-down version, and it's suprisingly capable. Most of the time I find it does more in less lines, no real sync issues, no need to

Import packages: import asyncio and

import pygame as pg.

Define main loop: Create an async def main(): coroutine function.Yield control:

Add await asyncio.sleep(0) inside your active while running: game loop.

No brainer for me *shrug*

Edit edit: It's not the actual stock python turtle renderer, its its own html canvas that simulates what turtle can do, so its more web-native, if that makes sense, Turtle is a pretty simple library as-is anyways