Forum Archive

New to Python - Jupyter Notebook

ysongofasiren

Hello! I‘ve started studying physics a week ago and in a lecture we need to use Jupyter notebooks to simulate some exercises. I‘ve never coded before so all this is very new to me. Our teacher provides the full code/jupyter notebook for us and we kind of just have to insert some numbers right now, so all the people who jever coded before get into it slowly.

My question is: is it possible to open a Jupyter notebook in Pythonista on iPad?

jgoalby

Check out Juno on iOS. Search for “Juno for jupyter” on the App Store.

ysongofasiren

Thank you for your answer! So there‘s no possibility to transfer it into a python file so I can open it in Pythonista somehow?

jgoalby

That’s an interesting question. I haven’t tried to do it. I did a little bit of research and came across the following that looks promising:

https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Importing%20Notebooks.html

“Importing Jupyter Notebooks as Modules

It is a common problem that people want to import code from Jupyter Notebooks. This is made difficult by the fact that Notebooks are not plain Python files, and thus cannot be imported by the regular Python machinery.

Fortunately, Python provides some fairly sophisticated hooks into the import machinery, so we can actually make Jupyter notebooks importable without much difficulty, and only using public APIs.”

There might be other approaches that will work. I used the following search:

copy jupyter code to python

lorentzd

@jgoalby
A really nice app and coding effort for iPadOS. I’ll give them a good review when I get get off of the IPadOS 14 beta program in a month or so. In the mean time, I’m enjoying it.

I’m already looking for some help to select an appropriate “shell” package for Juno.