285 questions
0
votes
0
answers
16
views
Load files in order with pyscript
I am using pyscript and I have a directory structure as follows:
index.html
Classes/Class_A.py
Classes/Class_B.py
where Class_A contains a class A and Class_B contains a class B which inherits from A....
-4
votes
0
answers
36
views
How to use pygame-ce in pyscript [closed]
Same as title. So yeah, I need help.
The tutorial(https://docs.pyscript.net/2025.3.1/user-guide/pygame-ce/) didn't help a lot.
More thorough version:
So the tutorial didn't provide enough code for me, ...
0
votes
0
answers
27
views
Can't get pyscript to import a simple module in the same directory. I see this question all over, but none of the solutions work for me
Should be pretty straight forward, but I keep getting this modulenotfound error. And it looks like every year they change the way to do it and deprecate all other ways.
This is my index.html
<!...
0
votes
1
answer
38
views
py:ready not being called on worker script
I'm running the example code from the documentation for py:ready:
<script>
addEventListener("py:ready", () => {
const status = document.getElementById("...
0
votes
0
answers
23
views
Config ignored and I don't know why
I'm playing a game called Deepest World all code is loaded into an iframe I was able to get pyscript running but when i inject the python script using document.createElement the config attribute is ...
0
votes
0
answers
118
views
Why is my PyScript code not working when trying to get input values from a form and send them to the backend?
I am trying to use PyScript to handle a form submission, get input values, and send them to a backend using a custom Python function. However, when I try to submit the form, it doesn't seem to trigger ...
1
vote
1
answer
42
views
Flask 405 Method Not Allowed for POST request from PyScript
I'm working on a Flask project where I need to send data from a PyScript (running in the browser) to the Flask backend using a POST request. However, when trying to make a POST request from the ...
0
votes
1
answer
53
views
how to do requestAnimationFrame in pyscript
from pyscript import document, window
from pyscript.ffi import create_proxy
class Canvas:
def __init__(self, id, width=64*9, height=64*9):
self.canvas = document.querySelector(id)
...
0
votes
1
answer
48
views
pyscript config file help for pandas and 2 Excel files
I'm using pyscript to run a function from an HTML page that reads an Excel file and returns the value from column two when column one is equal to a text input value on the HTML page. I want to ...
0
votes
0
answers
55
views
making recursive loop more efficient in a number generating function
i have this program where i ask the user to input the weight of plants that were harvested and then how many plants total were harvested, this then generates a list of numbers within a range of +100 ...
0
votes
1
answer
89
views
How to the fetch() function in PyScript with options
I am confused about the use of the fetch() function in PyScript.
There seems to be two versions of that function:
from the js module
from the pyscript module
Only the first one seems to accept two ...
0
votes
1
answer
58
views
Fetching JSON data with PyScript
I want to fetch json data with PyScript but cannot get over a
pyodide.ffi.JsException: TypeError: NetworkError when attempting to fetch resource.
It works with the sample data (the outcommented lines) ...
0
votes
1
answer
113
views
How to play a mp3 file with PyScript?
I want to play an mp3 file using the HTML tag like so:
<audio controls>
<source id="player" src="sounds//ziege.mp3" type="audio/mpeg">
</...
1
vote
1
answer
107
views
How to connect to my SQL server from Py script?
I am trying to connect to SQL server from Py script and I tried the same code of my jupyternotebook but the page shows blank after I import pyodbc. Is there any other way I connect to my SQL server ...
0
votes
2
answers
352
views
PyScript not displaying output
I am running a very basic pyscript code that accesses a python file.
The following is the HTML file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-...