From 1aad1bdf281539960b76094a5fb281affb7c870b Mon Sep 17 00:00:00 2001 From: "Nicholas H.Tollervey" Date: Tue, 11 Mar 2025 11:31:15 +0000 Subject: [PATCH 1/2] Bump version number. --- docs/beginning-pyscript.md | 8 ++++---- docs/user-guide/first-steps.md | 4 ++-- docs/user-guide/plugins.md | 10 +++++----- docs/user-guide/workers.md | 4 ++-- version.json | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/beginning-pyscript.md b/docs/beginning-pyscript.md index d9a63e7..de3d931 100644 --- a/docs/beginning-pyscript.md +++ b/docs/beginning-pyscript.md @@ -117,8 +117,8 @@ module in the document's `` tag: 🦜 Polyglot - Piratical PyScript - - + + @@ -168,8 +168,8 @@ In the end, our HTML should look like this: 🦜 Polyglot - Piratical PyScript - - + +

Polyglot 🦜 💬 🇬🇧 ➡️ 🏴‍☠️

diff --git a/docs/user-guide/first-steps.md b/docs/user-guide/first-steps.md index f0c20fc..a97a2cf 100644 --- a/docs/user-guide/first-steps.md +++ b/docs/user-guide/first-steps.md @@ -20,9 +20,9 @@ CSS: - + - + diff --git a/docs/user-guide/plugins.md b/docs/user-guide/plugins.md index 9a353f0..e49af88 100644 --- a/docs/user-guide/plugins.md +++ b/docs/user-guide/plugins.md @@ -100,7 +100,7 @@ For example, this will work because all references are contained within the registered function: ```js -import { hooks } from "https://pyscript.net/releases/2025.2.4/core.js"; +import { hooks } from "https://pyscript.net/releases/2025.3.1/core.js"; hooks.worker.onReady.add(() => { // NOT suggested, just an example! @@ -114,7 +114,7 @@ hooks.worker.onReady.add(() => { However, due to the outer reference to the variable `i`, this will fail: ```js -import { hooks } from "https://pyscript.net/releases/2025.2.4/core.js"; +import { hooks } from "https://pyscript.net/releases/2025.3.1/core.js"; // NO NO NO NO NO! ☠️ let i = 0; @@ -147,7 +147,7 @@ the page. ```js title="log.js - a plugin that simply logs to the console." // import the hooks from PyScript first... -import { hooks } from "https://pyscript.net/releases/2025.2.4/core.js"; +import { hooks } from "https://pyscript.net/releases/2025.3.1/core.js"; // The `hooks.main` attribute defines plugins that run on the main thread. hooks.main.onReady.add((wrap, element) => { @@ -197,8 +197,8 @@ hooks.worker.onAfterRun.add(() => { - - + + + PyWorker - mpy bootstrapping pyodide example diff --git a/version.json b/version.json index 439bf46..4dd7ba3 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2025.2.4" + "version": "2025.3.1" } From 8e9415975625e8495c8488f1b233ca730ef6247e Mon Sep 17 00:00:00 2001 From: "Nicholas H.Tollervey" Date: Tue, 11 Mar 2025 11:36:30 +0000 Subject: [PATCH 2/2] Info about input function in the main thread and JS prompts. --- docs/user-guide/pygame-ce.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/user-guide/pygame-ce.md b/docs/user-guide/pygame-ce.md index 58eebdc..a81766e 100644 --- a/docs/user-guide/pygame-ce.md +++ b/docs/user-guide/pygame-ce.md @@ -40,6 +40,17 @@ on the page. A config attribute can be specified to add extra packages but right now that's all it can do. +!!! Info + + Sometimes you need to gather text based user input when starting a game. + The usual way to do this is via the builtin `input` function. + + Because PyGame-CE **only runs on the main thread**, the only way to block + your code while it waits for user `input` is to use a + [JavaScript prompt](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt) + instead of input typed in via a terminal. PyScript handles this + automatically for you if you use the `input` function. + This is an experiment, but: * It is possible to use regular PyScript to load the pygame-ce package and use