Active Topics

 


Reply
Thread Tools
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#1
IPython is an enhanced Python interactive shell.

IPython package is available to MeeGo 1.2 Harmattan, so interactively using Python and its modules (like SymPy, NumPy, MatPlotLib, etc) becomes a lot easier.

See the "IPython for Maemo 4 & 5 & 6" topic in Talk Maemo.org for Maemo 4 Diablo and Maemo 5 Fremantle versions of IPython 0.10.2, which is the latest version compatible with Python 2.5 (so Maemo 4 & 5 can't have IPython >= 0.11).

There are 3 versions to choose to install on MeeGo Harmattan :
- IPython 0.13.2 (new, released in 15/06/2013, available in my Harmattan repository);
- IPython 0.10.2 (13/11/2011, 1.9 MB);
- IPython 0.10 (from Nokia repositories since 14/12/2011).

IPython 0.13 x 0.10.2 x IPython 0.10 packages :
- v0.13 for MeeGo Harmattan also has QtConsole and Notebook web interfaces, so MeeGo Harmattan is the only smartphone mobile OS which runs IPython QtConsole & Notebook;
- v0.13.2 is newer (05/04/2013) than v0.10.2 (09/04/2011) and v0.10 (04/07/2009);
- see the detailed differences in "What's New in IPython" in IPython site;
- v0.13 package takes from 5.5 MB (IPython terminal console) to 150 MB (complete IPython with Notebook & Qt console) after install, while v0.10.2 uses 8.0 MB and v0.10 only 6.6MB;
- optional IPython-doc v0.13.2 with examples and documentation takes 19.0 MB after install;
- v0.13 takes approx. 2.5s to open on a Nokia N9 @ 1 GHz, compared to about 1.4s for v0.10/0.10.2;
- v0.13 can be installed by enabling my Harmattan repository and installing via "apt-get install" or "MeeCatalog";
- v0.10.2 can be installed by tapping the .deb file (without using Terminal & apt-get install), after manual download;
- v0.10 is official from Nokia repositories;
- v0.13 & v0.10.2 are maintained and packaged for MeeGo Harmattan by me.

Version history :
- IPython 0.13.2 (05/04/2013) released for MeeGo Harmattan (15/06/2013), an upstream bug fix version of v0.13;
- IPython 0.13.1-3 Harmattan release (12/02/2013), a bug fix version for using Qt console;
- IPython 0.13.1-2 Harmattan release (22/01/2013), first release including Qt console and Notebook interfaces on MeeGo Harmattan;
- IPython 0.13.1-1 (21/10/2012) released for MeeGo Harmattan (06/01/2013), with only terminal interface;
- IPython 0.10.2 (09/04/2011) released for MeeGo Harmattan (13/11/2011), with only terminal interface.

Screenshots of IPython on a Nokia N9

Tapping the IPython icon or typing ipython on Terminal, then programming a little bit :


IPython Notebook 0.13.1 with Firefox (Fennec) v15 :


IPython Qt console 0.13.1 :


Application manager information about IPython Notebook 0.13.1-2, which takes 146 MB of installed files (but 134 MB due to MathJax for showing mathematical expressions) :


Installing IPython on MeeGo Harmattan

IPython 0.13.2-1 Harmattan can be easily installed by using my Harmattan repository. After configuring it, use :
- "MeeCatalog", searching for IPython there are IPython, IPython Notebook and IPython Qt console to choose, where IPython is installed by IPython Notebook and IPython Qt console;
- or Terminal as root :
# apt-get install ipython
or
# apt-get install ipython-notebook
or
# apt-get install ipython-qtconsole
or
# apt-get install ipython-notebook ipython-qtconsole
IPython terminal console uses 5.5 MB; IPython Notebook and IPython takes 146 MB (with 134 MB used by MathJax for displaying mathematical expressions on IPython Notebook); IPython Qt console and IPython uses 10 MB; IPython full installation (IPython Notebook, IPython Qt console and IPython) takes a total of 150 MB.

IPython 0.10.2 has manual download of the .deb package :
ipython_0.10.2-1harmattan1_all.deb (1.9 MB)
Using a file manager, tap in the file to install it.

IPython 0.10 is available in Nokia repositories, so to install use the Terminal, then become root by typing :
$ devel-su
and the 'rootme' password, then type :
# apt-get install ipython
confirming the installation.

The IPython installation also needs (and installs if not installed) Python/Python-Support packages (23 MB), but they are also used by other softwares.

Using IPython on MeeGo Harmattan

For all versions (0.10, 0.10.2 and 0.13), to use IPython terminal interface, type :
$ ipython
Time to open is about 2.5 s, or 4.5 s by tapping the icon in v0.13.
If you have PyLab (NumPy and MatPlotLib, see the topic "MatPlotLib - 2D & 3D plots for MeeGo Harmattan") installed, to load PyLab in interactive mode :
$ ipython --pylab
If you have SymPy installed, see the topic "SymPy (Computer Algebra System) for Maemo 4 & 5 & 6", to load SymPy in interactive mode :
$ isympy
or (for v0.13) :
$ ipython --profile=sympy

IPython 0.13 only :
After full installation, there are 3 new icons for : IPython, IPython Notebook (IPy Notebook) and IPython Qt console (IPy QtConsole).


IPython 0.13 terminal interface : tap the IPython icon. You can have many IPython consoles open at the same time. Or use the Terminal to start IPython, see above.

IPython 0.13 Qt console : tap the "IPy QtConsole" icon, it takes approx. 9.7 s to open. It has a Qt GUI with very small fonts, but it works very well. Hints :
- use menu "View -> Zoom In (Ctrl + +)" 2-4 times to improve reading the text;
- use menu "View -> Full Screen (F11)";
- MeeGo virtual keyboard (vkb) works ! But it is opaque, so scroll the text up (with the vertical scroll bar or vertical keyboard arrows) so the vkb is not above the current text;
- use MeeGo vkb with arrows by installing "MesInput" (from Nokia Store) and choosing "English with arrows". Or use Swype vkb in edit keyboard mode, with arrows;
- the best usage is with external Bluetooth or N950 keyboard, so all keyboard shortcuts work, with Ctrl, Alt, etc. When using external Bluetooth keyboard, install and use "Empty VNC" vkb from "MesInput" (from Nokia Store);
- to load PyLab, type "%pylab", with inline plots, type "%pylab inline" (see the screenshot below);
- or use Terminal, e.g., "$ ipython qtconsole", "$ ipython qtconsole --pylab", "$ ipython qtconsole --pylab=inline", "ipython --profile=sympy".

IPython 0.13 Notebook : tap the "IPy Notebook" icon, taking 17s to open with Firefox v15 as default web browser. If "$BROWSER" variable has no content, it will show a Terminal with :
[NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
[NotebookApp] Use Control-C to stop this server and shut down all kernels.
[NotebookApp] No web browser found: could not locate runnable browser.
So you can open a web browser and point it to "http://127.0.0.1:8888/".

Or you can configure the $BROWSER variable by choosing one web browser, using Terminal and typing "export BROWSER=<pathname-to-web-browser>". To make this configuration automatic for :
- MeeGo Harmattan native web browser, type in Terminal :
$ echo 'export BROWSER=/usr/bin/grob' >> ~/.profile
- Fennec/Firefox from Nokia Store, type :
$ echo 'export BROWSER=/opt/fennec/lib/fennec-15.0/fennec' >> ~/.profile
- Opera Mobile, type :
$ echo 'export BROWSER=/opt/operamobile-labs/bin/operamobile-labs' >> ~/.profile
Then reboot your Nokia N9 so this configuration will take effect.

My analysis of the 3 above web browsers :
- Firefox mobile (v15) is the best one for IPython Notebook use, rendering MathJax (mathematical symbols) very well. Only issue is that vkb arrows don't work, as well as Bluetooth keyboard (haven't tried N950 keyboard) don't work at all;
- Grob (default web browser) has serious problem of not showing more than 1 page of the notebook... it is a pity because vkb arrows and Bluetooth keyboard work very well;
- Opera Mobile 12 doesn't render MathJax (mathematical symbols), sometimes tapping the Notebook menu doesn't work, its vkb doesn't have arrows, and Bluetooth keyboard has no arrows, backspace, shift-enter, etc working.

Snowshoe Qt5, Helium and UC Browser don't work with IPython Notebook.

Fennec-QML (using IPCLiteAPI) v0.0.1 shows promise : renders MathJax, doesn't zoom in/out automatically like Firefox, perfect use of keyboard (vkb or Bluetooth) so vkb arrows and shift+enter are ok, Bluetooth keyboard with all woking shortcuts. But it is unstable (closes sometimes), has problem scrolling long notebooks (only vertical arrows of Bluetooth keyboard work) and can't select "New Notebook" or "Cell" type.

Some hints for using (Firefox mobile v15 with) IPython Notebook on Nokia N9/N950 :
- change the focus to the menu (tap twice in the horizontal menu) to navigate over the notebook content. Or else it will zoom in/out, scroll and show the vkb automatically...
- to edit some non-code cell, convert the cell to code cell, edit, than change to the previous cell type. It is because double tapping is filtered by Firefox to zoom in/out, and double tapping is needed to edit non-code cells;
- portrait mode is better to type with the vkb because it uses less screen space;
- be patient when opening medium/large notebooks with many formulas, plots, etc. Firefox mobile is slow and Nokia N9/N950 has a Cortex A8 @ 1 GHz;
- to load PyLab, type "%pylab", with inline plots, type "%pylab inline" (see the screenshot below);
- or use Terminal, e.g., "$ ipython notebook", "$ ipython notebook --pylab", "$ ipython notebook --pylab=inline", "ipython notebook --profile=sympy", "ipython notebook --pylab=inline --profile=sympy". You can create a script for each case, or even a .desktop file in "/usr/share/applications".

IPython Notebook 0.13.2 on Nokia N9 can also run as a server for remote web clients (PC's, Nokia N900, Android devices, etc), see post #19.

IPython documentation :
- online in the IPython.org site;
- examples and HTML manual in "/usr/share/pyshared/IPython-doc/" after enabling my Harmattan repository and typing as root in Terminal :
$ apt-get install ipython-doc
which takes 19.0 MB.

Some features of the IPython interactive shell :
- tab (or ctrl+i) completion for objects;
- input history navigation using up (or Ctrl+p) and down (or Ctrl+n) arrows;
- search input history by typing partial input then up/down arrow to show matching lines, or ctrl+r to have a serch prompt;
- input line n can be retrieved using '_in', 'In[n]', '_ih[n]', and _i, _ii, _iii to access the previous, next previous and next-next previous inputs;
- output line n can be retrieved using '_n', 'Out[n]', '_oh[n]', and _, __, ___ access the previous, next previous and next-next previous outputs;
- information about objects using '?word' or 'word?', full information with '??word' or 'word??';
- magic command system, like '%run file.py', '%pwd';
- run system commands with '!' as prefix, e.g., '!ls".
More details in :
IPython interactive tutorial
IPython Interactive Reference
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2013-06-16 at 06:40. Reason: IPython 0.13.2 released
 

The Following 15 Users Say Thank You to rcolistete For This Useful Post:
Captwheeto's Avatar
Posts: 302 | Thanked: 193 times | Joined on Oct 2008 @ England
#2
I don't own an N9 but this is awesome! I'm not liking the looks of lambda expressions in python though
 

The Following User Says Thank You to Captwheeto For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#3
On Nokia N9/N950 it is also possible to install other Python modules listed here :
http://wiki.meego.com/Harmattan_Python

For example, to install NumPy, open the Terminal, enter root ('$ devel-su' and 'rootme' as password) then type :
# apt-get install numpy
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2011-11-15 at 03:50.
 

The Following 2 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#4
Good news : I was told by a Nokia Python developer that IPython will be included in Nokia's repositories in the next release (of Harmattan, I suppose). So "apt-get install ipython" will work in the future.

But until this happens, the two IPython .deb's cited above in this topic are the solution to install and use IPython on your Nokia N9/950.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 

The Following 4 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#5
From MatPlotLib - 2D & 3D plots for MeeGo Harmattan post :

Originally Posted by vielfrass View Post
Will it be possible to have the QT iPython console on the N9 some day?
http://ipython.org/ipython-doc/dev/i...qtconsole.html
This is a new feature of IPython 0.11 (while IPython for MeeGo Harmattan is currently in version 0.10.2). But the Qt-console has some hard to compile dependencies, ZeroMQ and PyZMQ, not available to MeeGo Harmattan. So I would also need to make these dependencies...

The more interesting is IPython 0.12, currently being developed, because it has a notebook interface using web browser ! But it has yet more dependencies :

http://ipython.org/ipython-doc/dev/i...lnotebook.html
http://lighthouseinthesky.blogspot.c...notebooks.html
http://lighthouseinthesky.blogspot.com/2011/09/ipython-notebooks-second-impressions.html

I will try to make IPython 0.11/0.12 compatible to MeeGo Harmattan, it is a matter of some weeks to work on it. Maybe Qt console and/or notebook interface will run on Nokia N9/N950...
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2011-11-26 at 22:01.
 

The Following 2 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#6
IPython 0.10 is now available in Nokia's repositories.

So if you want IPython 0.10 instead of 0.10.2, it is simpler to install it, depend on it, etc.

See the 1st post updated.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2012-02-05 at 02:15.
 

The Following 2 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#7
IPython 0.10.2 is now also released for Maemo 4 Diablo and Maemo 5 Fremantle, see the "IPython for Maemo 4 & 5 & 6" topic in Talk Maemo.org.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 

The Following 2 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#8
Good news for all Python users on MeeGo Harmattan : the best interactive Python environment, IPython, has its v0.13.1 released !

The QtConsole and Notebook interfaces for IPython v0.13.1 aren't available for MeeGo Harmattan as they have a lot of dependencies not yet packaged for MeeGo Harmattan. Maybe I will have success compiling the IPython Notebook dependencies : Tornado, PyZMQ and ZMQ. Until then, you can install Easy Debian Harmattan with scientific version based on experimental Sulu's Debian wheezy image, which has IPython 0.13, including Notebook and QtConsole interfaces.

The IPython v0.13.1 was packaged in 58s on a Nokia N9 running Harmattan SDK on chroot, see the topic "Compiling & packaging on MeeGo Harmattan device".

The blog post "Scientific Python for computers, tablets and smartphones" shows that MeeGo Harmattan is the only mobile OS with IPython >= 0.11 (Maemo 4 & 5 have IPython 0.10.2). Android, Blackberry OS, iOS, Symbian and Windows Phone don't have IPython at all. Even some desktop OS distributions don't have yet IPython 0.13.1.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2013-01-06 at 21:20.
 

The Following 8 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#9
Update : "ipython_0.13.1-1harmattan1_all.deb" (now with 1.1MB) is updated with less 0.6 MB which were not useful ("/usr/share/doc/ipython/examples/" which are purged anyway by MeeGo doc-purge). This fix was made just 3h after announcing the file, so I think it was not worth to update to '2harmattan2' subversion.

So, who downloaded "ipython_0.13.1-1harmattan1_all.deb" (with 1.7 MB) and installed it before, do it again.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2013-01-07 at 01:43.
 

The Following User Says Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#10
Released IPython 0.13.1 examples and documentation in .deb file, "ipython-doc_0.13.1-1harmattan1_all.deb" (7.2 MB), see 1st post.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 

The Following 4 Users Say Thank You to rcolistete For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 05:31.