You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/running-offline.md
+16-6Lines changed: 16 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -85,10 +85,16 @@ Alternatively, if you would like to test also `worker` features, you can try ins
85
85
```sh
86
86
npx static-handler --coi ./public/
87
87
```
88
+
## Downloading and Setting up a Local Interpreter
88
89
89
-
**Please note this page still needs the network to load** so that both *MicroPython* or *Pyodide* will be fetched from related CDN ... we are getting close though!
90
+
Good news! We are almost there. Now that we've:
90
91
91
-
### Install MicroPython locally
92
+
* downloaded PyScript locally
93
+
* created the skeleton of an initial PyScript App
94
+
95
+
we need to download and setup up an interpreter. PyScript officially supports *MicroPython* and *Pyodide* interpreters, so let's see how to do that for each one of them.
96
+
97
+
### Download MicroPython locally
92
98
93
99
Similarly to what we did for `@pyscript/core`, we can also install *MicroPython* from *npm*:
94
100
@@ -129,9 +135,7 @@ That folder should contain at least both `micropython.mjs` and `micropython.wasm
129
135
</script>
130
136
</body>
131
137
</html>
132
-
```
133
-
134
-
We are basically done: if we try to disconnect from the internet but we still run our local server, the page will still show that very same *Hello from PyScript* message :partying_face:
138
+
```
135
139
136
140
### Install Pyodide locally
137
141
@@ -178,9 +182,15 @@ At this point, all we need to do is to change our *HTML* page to use *pyodide* i
178
182
</html>
179
183
```
180
184
185
+
## Wrapping it up
186
+
187
+
We are basically done! If we try to disconnect from the internet but we still run our local server, the page will still show that very same *Hello from PyScript* message :partying_face:
188
+
181
189
We can now drop internet, still keeping the local server running, and everything should be fine :partying_face:
182
190
183
-
### Local Pyodide Packages
191
+
## Local Pyodide Packages
192
+
193
+
There's one last thing that users are probably going to need: the ability to install Python packages when using Pyodide.
184
194
185
195
In order to have also 3rd party packages available, we can use the bundle from [pyodide releases](https://github.com/pyodide/pyodide/releases/tag/0.24.1) that contains also packages.
0 commit comments