Is it possible to deploy jupyter Notebook python console on browser using binder or using GitHub?
I donât think you can launch direct to a console via MyBinder URL. Iâm surprised, but I couldnât come up with a combination to get to that endpoint. You can always launch direct to a JupyterLab interface with a notebook open and then using the content in markdown in that notebook, guide the user step-by-step how to get the console. (I wonder if there is some trick with ipylab to do it via a click or button? But I couldnât come up with the route yet.)
(The ipdb console is similar, see here, and so you could have triggering that in a notebook that lunches via MyBinder. However, it is probably more complex than youâd want to present to users for an interface. So I only mention it as an aside.)
PythonAnywhere offers something more along the lines of what I think you want:
You can point PythonAnywhere at a gist and get a console that runs that code.
Example:
Click here to see code run and get a session where you can continue to query it. After it runs, I suggest typing %whos at the prompt on the console and you can see what variables are active and defined.
Of course the user can continue to type whatever they want in the ipython console, too.
See the â Create your own Gist Consoleâ on the left side pane by scrolling down for more about it. You are looking for the text âCreate a console for a different gist >>â that will lead you here.
The gist I pointed the creator at is this one.
JupyterLite does have a direct to REPL option.
Example:
https://jupyterlite.github.io/demo/repl/index.html?kernel=python
Put that in your browserâs URL address bar and youâll get one.
See more about it here.
Since GitHub can launch JupyterLite sessions, you can host it under your own repo and have more control. See here.
https://jupyterlite.github.io/demo/repl/index.html?kernel=python
This link does not run python code. I am able to write python code. I even tried
âjupyter nbconvert --to html Untitled71.ipynb --output index.htmlâ
but it gives me the following error.
âJupyterLite requires JavaScript to be enabled in your browser.â
My javaScript is enabled but it still shows the error.
I am not sure of the image icon I got?
That link https://jupyterlite.github.io/demo/repl/index.html?kernel=python works with a pyodide kernel as this screenshot shows:
Pyodide kernel is one of the Web Assembly based Python kernel.
The JupyterLite documentation has more information.
The first two tiles at Try Jupyter use it, too. You may have better luck with those?
jupyter nbconvert --to html Untitled71.ipynb --output index.htmlâ is not Python code. That is a jupyter nbconvert command that is command line-based command. You asked about a Python console. Not about running commands.
You could run jupyter nbconvert --to html Untitled71.ipynb --output index.htmlâ from MyBinder by making a repo, and putting a notebook in it with that as a cell with an exclmation point in front of the command. Then you can use MyBinder directly launch the notebook with that content and the user can run it.
However, please try to keep to the thread topic that you posted about and donât take things to an unrelated discussion.
How did you make the python code run?Enter takes me to next line and I tried control enter even it didnât run the code.
On my machine in Chrome, it is like entering code in a Jupyter cell where I use shift+Enter to execute it.
âshift+Enterâ worked. Adding a run button would be better I feel becz I am not sure of âshift+Enterâ working for mobile.
Much of JupyterLite is active development as it is relatively nascent given Jupyter Notebook in general. You should look in the JupyterLite GitHub repo and see if others have filed an issue about this. If not, you can file a feature request there so the developers will see it. Better yet as it is open source, you can even take the next step add the feature and make a pull request. Iâd start with engaging the developers with an issue request though as there may be a way to already have that but the demo doesnât feature it. Or at least not that one.
Thereâs options
I did try point out that it was a starting point and could be customized.
In that vein (or maybe parallel) the Sympy Online shell example belongs in this conversation anyway, especially since you arenât happy with the UI.
I think the Sympy Online shell pre-dates the repl I pointed you at; however, it is using JupyterLite.
The repo is here.
To see it in actionâŚ
To try it go to the main Sympy page here. Then on the navigation banner across the top choose âOnline Shell.â
(Be patient, and donât be surprised if it takes a couple of tries for it to be read to enter code. My first access of it today with a direct URL, it didnât like (hung on busy at starting up), but then I went to the SymPy page and through and then was patient. After initializing, it should it was read via the kernel status indicator in the upper right.)
Now you can enter Python code. (It already has SciPy loaded so you can use that package, which is the focus, but Python will work, too.)
Importantly, youâll see that one can use Enter alone to run code. So either it is based off a slightly different model, or they customized it. (Oh here it says it is customized from the main REPL of the jupyterlite/demo, so I think it is presently based on what I pointed you at earlier and so you can clearly see from this more advanced example you can customize it.) The code is at the repo so you can modify it.
It is though JupyterLite powered. They even feature the logo in the upper right of the Shell.
I have many python consoles deployed in my GitHub using pyscript.I am exploring more on a way we can deploy the python console of Jupyter Notebook on browser.
I am new to Github.How can I add the feature and make a pull request?
Largely, that is beyond the scope of this forum. I can offer some ideas on how would want to proceed to start to work the git/GitHub involved-part of that.
GitHub is just one on of the central git-users hubs. GitLab is another.
You would need to learn about git use first to fork & pull the current development state, make a branch, and implement your update. (If you donât yet know how to approach implementing such an update to the code, then you wouldnât pursue that avenue.)
Once you have implemented it on your fork, then you make a pull request from your fork. These days GitHub prompts you on how to do that when you use the web interface to check when you pushed updates to your fork/branch.
Having said all that. Start small learning git and doing things in your own repositories. Thereâs a lot of guides out there to help you learn how to use git.
When you are ready to contribute to open source projects start with filing an issue and propose how you would fix it. Documentation issues are often a good start. Usually the other developers/maintainers will then chime in on the issue and if you ask about how to best handle pushing the change, theyâll usualy tell you how to theyâd like you to proceed. Some repos/communities will even label issues as âgood first issueâ to help make it easier to onboard new contributors.(See here for example where it says, âThis should be an easy fix, suitable for beginnersâ.)
If it was a small thing and you knew how to change it, you could jump to a pull request to start the dialog, but it sounds like you arenât there.
To get started, besides learning git on your machine and in conjunction with GitHub of your own repos, you can look at other past closed issues and pull requests and see how the developers in that community like things done.
In short, for now stick with bringing things up in projects as âissuesâ posts on GitHub; however, be prepared to not get much traction unless it is a critical thing you find first or you can offer a solution. For now, even if all you offer is an idea or small code change as an example code block, it is better than nothing and if itâs straightforward, the developers/maintainers may be prepared to incorporate it and it would be convenient for them as they are actively developing on the project already.
Can someone from the community give me a video call to guide me with all of this?

