Okay, it was JupyterLite. That is using the Pyodide kernel.
In the screenshot you show of the ‘Try Jupyter’ page, the paragraph directly above where you highlighted Jupyter Notebook says with warnings:
Experimental several of the environments below use the JupyterLite project to provide a self-contained Jupyter environment that runs in your browser. This is experimental technology and may have some bugs, so please be patient and report any unexpected behavior in the JupyterLite repository."
Anyway, this explains why you are seeing the need for await()
.
I suggested how to do that in the last paragraph of the post right above yours from today.
I’ll add that if the full Python kernel is one you want, you can set up GitHub repos or gists to already install the things you want using configuration files that the MyBinder service recognizes that often just boil down to listing what you need. Examples that you can launch with the dependencies listed in requirements.txt
already by pressing ‘launch binder’ at the sites:
And keep in mind those are temporary sessions. If you make anything useful, download it to your local system immediately. You can upload notebooks you have to a fresh temporary Jupyter session.
As for the issue with your code with num = int(await(input("number please:")))
…
The easiest solution is to remove the await()
and use a full Python kernel (ipykernel) using the method I said above.
As for the issue with your code with num = int(await(input("number please:")))
, the input part is supposed to be await input()
, see here.
If you make a cell with that as the content:
num = int(await(input("number please:")))
And then run it and enter a number. In the next cell you can put num
in the cell and execute it and it will give you the value.
But as you’ve found you cannot do the loop you want to do using JupyterLite / Pyodide kernel at this time. See here for much the same question in a less complex context compared to your while loop in the same cell. Note that putting type(raw)
after the await input()
line doesn’t result in displaying the type in the previous cell.
And the second after await the code is not processed further
The reply is there:
We did not find a way around this for now. But if you have ideas please share them in the issue I just mentioned
In theory there is complex way to do it with a service worker; however, at this time it remains a challenge to make it something closer to what is expected. More about what is going on and options in JupyterLite / Pyodide here.