During this global lockdown, it's interesting to observe an upsurge in learning python and in particular machine learning. There are innumerable free online resources and teachers from where or whom you can learn, but all use a common open-source software (or its clone) - Jupyter Notebooks. It's one of the most useful tools for all ranks of data scientists/engineers/analysts.
While teaching online, the teachers either prerecord the sessions or consider taking sessions live. During live sessions most of the teachers use one of several video conferencing platforms, coding on their local machine (or ready-to-run notebooks) and share it live. This has two serious demerits -
- Internet penetration is still worse for many developing countries. So viewing code onscreen or receiving a clear audio is a still a distant dream for many.
- If students want to just run few lines of code or check their doubts regarding the code shared onscreen during sessions, they have no option to copy. It has to be either shared by the teacher before the session or the teacher has to pause for extra few minutes on each code blocks.
Being a teaching assistant myself for several data science courses, I have noticed few good and enthusiastic teachers discussing on the lack of free video conferencing with live code sharing platforms. There isn't any!
Well, for now, an audio conference with live code sharing shall suffice.
For live code sharing, one solution is very obvious - Google Colab Notebooks. It's the best resource built for data science EVER!
In this article I shall provide you an alternate free option for live code sharing, which might help you. At the least, it's a good feature to know.
You can share your local Jupyter notebooks live with a small group while hosting a session.
You already have Jupyter notebooks installed locally.
- Download ngrok locally.
- Follow all the steps mentioned till step 3.
- Before firing up the ngrok or a Jupyter notebook, run
- Copy the address mentioned after
Writing default config to:
- Then run the code below, replacing your address (from the step above) instead of mine.
- For a secured session, set the password for your Jupyter Notebook by running
- Fire up your Jupyter notebook and keep a note of the port
- Open a new tab in your terminal and fire up ngrok on your port
Your terminal would show something similar to
Copy the HTTP link with ngrok.io at the end and share it with your group with the notebook password. You get an 8-hour session.
Each time you write a new line/block of code in your notebook press Ctrl+S (Linux/Windows) or Cmd+S (macOS) to share the updated notebook. The group members have to refresh on their end to see those changes.
Note: As a host if you receive an alert like this
Overwrite so that whatever changes you make during the session remains intact for that session.
That's how you share your code session live with a group for free while working on your local machine and simultaneously allowing your group to code on the notebook during the session and eventually letting them download the session notebook.
Thanks to Project Jupyter and ngrok.
Let me know if you have any better idea.