Skip to content

Commit 28918d5

Browse files
committed
Add details about offline.zip and IDE configuration with Python stubs.
1 parent 5133a9e commit 28918d5

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ bin
55
lib
66
lib64
77
pyvenv.cfg
8+
*.swp

docs/beginning-pyscript.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,41 @@ points to the `div` element with the id "output". Finally, we assign the
231231

232232
That's it!
233233

234+
## Editing you app
235+
236+
If you use an IDE (like VSCode or PyCharm) then you'll probably want them to
237+
auto-suggest and introspect aspects of the Python code you're writing. The
238+
problem is that the `pyscript` namespace *we provide* isn't installed anywhere
239+
(because it's in your browser, not your IDE's context) so such information
240+
isn't, by default, picked up.
241+
242+
Thankfully Python stubs come to the rescue.
243+
244+
Members of our community have
245+
[created Python stub files for PyScript](https://github.com/pyscript/pyscript-stubs).
246+
You should clone the linked-to repository and configure your IDE to consume the
247+
stub files.
248+
249+
For example, let's say you
250+
[cloned the repository](https://github.com/pyscript/pyscript-stubs) into:
251+
`~/src/stubs/pyscript-stubs`, then in VSCode, you'd create, in your PyScript
252+
project, a file called `.vscode/settings.json` and add the following:
253+
254+
```js
255+
{
256+
"python.analysis.stubPath": "~/src/stubs/pyscript-stubs/src/pyscript-stubs"
257+
}
258+
```
259+
260+
Then restart the Python language server in VSCode (Press `Ctrl+Shift+P` (or
261+
`Cmd+Shift+P` on Mac) to open the Command Palette and type:
262+
`Python: Restart Language Server`.
263+
264+
!!! note
265+
266+
The stubs themselves are found within the `src/pyscript-stubs` directory
267+
in the git repository, hence the longer path in the configuration file.
268+
234269
## Sharing your app
235270

236271
### PyScript.com
@@ -263,6 +298,12 @@ To run PyScript offline, without the need of a CDN or internet connection, read
263298
the [Run PyScript Offline](user-guide/offline.md) section of the user
264299
guide.
265300

301+
We also provide an `offline.zip` file with
302+
[each release](https://pyscript.net/releases/2025.11.2/). This file contains
303+
everything you need for an offline version of PyScript: PyScript itself,
304+
versions of Pyodide and MicroPython, and an index.html page from which you
305+
could create your offline-first PyScript work.
306+
266307
## Conclusion
267308

268309
Congratulations!

0 commit comments

Comments
 (0)