pyodide-worker-runner icon indicating copy to clipboard operation
pyodide-worker-runner copied to clipboard

Pyconsole

Open tomitrescak opened this issue 2 years ago • 2 comments

Hello. What a fantastic package, but unfortunately, many of the things you did here go beyond my capability to make it work in my project. Would you find a moment of time to give an idea how:

  1. Connect the stdin to pyodide console from their own pyodide console? I.e. the console uses interpreter (command) to read from (jquery) console. I imagine it would be calling one of your functions
  2. I do not want to read files from a zip file, but from a database, i.e. I want to pass an array of files with {name, source}[] format.

Thank you!

tomitrescak avatar Jun 13 '23 02:06 tomitrescak

Nevermind ... this has to be called in a worker.

tomitrescak avatar Jun 13 '23 10:06 tomitrescak

@alexmojaki i learnt a lot going through your solution. I managed to get the sharedarraybuffer working with my next.js instance and others.

But, I still struggle to make your solution work.

Would you mind sharing a simple gist that shows how to wire everything together? All I would love to see is a text box, and a button. When button is pressed, the code is sent to the worker and executed. If the code calls input() it will wait for input from text box.

I kind of now understand how to start … but it does not work for me. Thank you.

tomitrescak avatar Jun 17 '23 10:06 tomitrescak