Skip to content

Commit

Permalink
fix relative url attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Aug 23, 2024
1 parent aa1dd37 commit 6d4b1fc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ It will warn you the certificate is not signed, just click proceed.

## Technical stuff

## Pyscript and pyodide

To interface between the browser and Python interpreter we're using Pyscript, which in this case runs pyodide a WASM port.

Note there is no transcompilation to Javascript, the python code runs entirely in a true CPython environment.
Expand All @@ -65,6 +67,14 @@ As graphical display we use a native `<svg>` element in the browser. This has th
Typically for videogames you would choose `<canvas>`, as svg is slower for videogames but
since lib is thought for educational purposes svg is sufficient.

## File paths

Pyscript needs a way to find your python files.

If you deploy to a server with a subpath you have to set PATH [template](https://docs.pyscript.net/2024.8.2/user-guide/configuration/#files) in accordingly in [pyscript.json](pyscript.json)

For example, normally the `PATH` would be just `/` but in the demo https://coderdojotrento.github.io/turtle-pyscript/ the `PATH` must be set to `/turtle-pyscript`

## Credits and inspiration

- some code initially was taken from [Pyscript Antigravity example](https://pyscript.net/examples/antigravity.html)
Expand Down

0 comments on commit 6d4b1fc

Please sign in to comment.