@@ -499,17 +499,17 @@ store = await storage("my-data-store", storage_class=MyStorage)
499
499
500
500
### ` @pyscript/core/donkey `
501
501
502
- Sometimes you need a Python worker ready and waiting to evaluate any code on
503
- your behalf. This is the concept behind the JavaScript "donkey". We couldn't
504
- think of a better way than "donkey" to describe something that is easy to
505
- understand and shoulders the burden without complaint. This feature
502
+ Sometimes you need an asynchronous Python worker ready and waiting to evaluate
503
+ any code on your behalf. This is the concept behind the JavaScript "donkey". We
504
+ couldn't think of a better way than "donkey" to describe something that is easy
505
+ to understand and shoulders the burden without complaint. This feature
506
506
means you're able to use PyScript without resorting to specialised
507
507
` <script type="py"> ` style tags. It's just vanilla JavaScript.
508
508
509
509
Simply ` import { donkey } from '@pyscript/core/dist/core.js' ` and automatically
510
510
have both a * pyscript* module running on your page and a utility to bootstrap a
511
- terminal based worker to evaluate any Python code as and when needed in the
512
- future.
511
+ terminal based worker to asynchronously evaluate any Python code as and when
512
+ needed in the future.
513
513
514
514
``` js title="A donkey worker"
515
515
import { donkey } from ' @pyscript/core/dist/core.js' ;
@@ -521,7 +521,7 @@ const {
521
521
clear, // clear() the terminal
522
522
reset, // reset() the terminal (including colors)
523
523
kill, // kill() the worker forever
524
- } = donkey ({
524
+ } = await donkey ({
525
525
type: ' py' || ' mpy' , // the Python interpreter to run
526
526
persistent: false , // use `true` to track globals and locals
527
527
terminal: ' ' , // optionally set a target terminal container
0 commit comments