Re: [Python-ideas] Should iPython Notebook replace Idle

On Jul 4, 2015 5:16 AM, "Jason Swails" <jason.swails@gmail.com> wrote:
On Fri, Jul 3, 2015 at 10:01 PM, Sayth Renshaw <flebber.crue@gmail.com>
In future releases of Python should ipython Notebooks replace idle as
3. Would allow teachers to setup notebooks knowing that all users have
wrote: the default tool for new users to learn python? the tutorials as they proceed. No download separate code retyping just edit run and play. the same default environment, no need for setting up virtualenvs etc. the Python stdlib imposes some pretty serious restrictions on a library. If the IPython team agreed to release their tools with the stdlib instead of IDLE, they'd have to give up a lot of control over their project:
happening.
It is certainly true that IDLE and IPython do not cover the same use-cases, and it almost certainly true that putting the IPython notebook into the standard library is infeasible. That being said, one thing that IPython and other shells have shown is that it is possible to make a much more powerful python shell. So I don't think it is out of the realm of possibility to take a hard look at the current python shell and see where and how it can be made more useful. The IPython shell is one of many places we could look for ideas. More out-there, but it probably isn't completely impossible for python to provide some sort of native notebook-like interface, or at least some sort of interface that makes it convenient for third parties to make such notebook interfaces.

On 4 July 2015 at 18:56, Todd <toddrjen@gmail.com> wrote:
Software Carpentry already recommend the IPython Notebook to research scientists and data analysts learning Python (understandably so, since IPython Notebook is built by and for research scientists and data analysts). The needs for programming education are different, and the Raspberry Pi Foundation are starting looking at the available options in that space (including asking the question of whether or not there should be "Python for Education" edition that bundles additional third party libraries that don't make sense to include in the default installation. There's certainly scope for improving IDLE itself (within the constraints of "no dependencies outside the standard library"), but part of that includes refactoring IDLE to make it easier to work on and test. idle-dev is the appropriate list to find out more about the options there. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

I just want to add the the IPython team has no plan to request, or try to have IPython to be incorporated into standard library. We are happy and our users seem to be happy with it as an external package. This also allow us to do quicker releases, changes our dependencies (and our dependencies are growing), basically leave us more freedom. It would also be funny to require nodejs to build the Javascript that would need to be shipped for the notebook... And despite some people loving IPython and the Notebook, we are the first to admit that the notebook is not the best tool for everything. We are still using vi/emacs/nano/ed/$EDITOR/$IDE to program, and it is better suited for a lot of tasks. Where notebook files are hard to edit in text editor[1]. That being said we would love to get some IPython-shell feature in the interactive python shell, like numbered prompt by default, and a way to have the help syntax with `?` easier to hook into, instead of doing reg-ex transform on the input. With the more an more increasing pain of deadline on window we are also looking into pypython[2] and enable it by default in the IPython shell, there are a lot of really good improvement ideas for the plain shell that can be taken from that too. -- M [1] Yes I am aware of IPymd, but still you cannot break a class in between cells. [2] https://github.com/jonathanslenders/ptpython <https://github.com/jonathanslenders/ptpython>

On Sat, Jul 4, 2015 at 12:11 PM, Matthias Bussonnier < bussonniermatthias@gmail.com> wrote:
Pros: * already installed * (C)Python community review Cons: * CPython release schedule * CPython dependencies do not include the IPython dependencies * CPython Makefile * https://hg.python.org/cpython/file/tip/Lib * Core Developers For the hypothetical case that IPython and dependencies all decide to migrate their projects to the CPython source tree: Docs: https://docs.python.org/devguide/stdlibchanges.html#adding-a-new-module Docs: https://docs.python.org/devguide/stdlibchanges.html#adding-to-a-pre-existing...
It would also be funny to require nodejs to build the Javascript that would need to be shipped for the notebook...
And TypeScript.
!cp io.log scriptname.py %ed ./scriptname.py
%doctest_mode

On Sat, Jul 4, 2015 at 8:26 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:
* http://software-carpentry.org/blog/2012/03/the-ipython-notebook.html * http://software-carpentry.org/blog/2013/03/using-notebook-as-a-teaching-tool... * https://software-carpentry.org/v5/novice/python/06-cmdline.html (IPython)
I believe it's possible to run Docker and LXC on a Raspberry Pi (ARM arch). https://github.com/ipython/ipython/wiki/Install:-Docker * IPython, Scipy Stack (CPython, Anaconda conda packages, pip packages) https://wrdrd.com/docs/consulting/education-technology#jupyter-and-learning * There are extensions to include which packages/modules are/were installed/necessary for a given notebook (watermark, version_information) #jupyter-and-reproducibility
Some of my first lines of Python were in IDLE (with diveintopython 2).

Todd <toddrjen@gmail.com> wrote:
It will not be possible because of this: https://jupyter.org Having Jupyter in the Python standard library would screw over the Julia and R users. Also, more extensive Python distros like Anaconda and Enthought Canopy include IPython/Jupyter by default. I think it is more important to start to direct users to select these than to include Jupyter in the standard lib. This is particularly important because of the growing number of essential packages that are not in the standard lib (e.g. NumPy, Cython, Numba, matplotlib, wxPython, Twisted, pymq, Sqalchemy, etc.) and the complex package dependencies. Another question is whether python.org should provide links to these installers, or even maintain a similar Python stack with a package manager (I am not sure if pip can handle all the complexities sufficient). Sturla

Well they still have to install CPython to install Jupyter and even Python3 if they want multi-user... so I’m not sure that would “screw” them. (or I don’t get why you mean by screw them).
One possible, simpler thing would be to ship a minimal python kernel [1] that ‘only’ requires PyZMQ. Though, now that pip “Just works"[2], I ‘m not sure it is worth either. -- M [2]: offer subject to conditions [1]: https://github.com/dsblank/simple_kernel/blob/master/simple_kernel.py <https://github.com/dsblank/simple_kernel/blob/master/simple_kernel.py> # simple_kernel.py # by Doug Blank <doug.blank@gmail.com> # # This sample kernel is meant to be able to demonstrate using zmq for # implementing a language backend (called a kernel) for IPython. It is # written in the most straightforward manner so that it can be easily # translated into other programming languages. It doesn't use any code # from IPython, but only standard Python libraries and zmq. # # It is also designed to be able to run, showing the details of the # message handling system.

On 04/07/15 22:16, Matthias Bussonnier wrote:
Release schedules and development would be swallowed into Python. If they need a bugfix for Julia or R, they have to wait for the next release of Python. There would also be Julia and R related issues in the CPython bugtracker.
One possible, simpler thing would be to ship a minimal python kernel [1] that ‘only’ requires PyZMQ.
Only? This would require a C++ compiler. Currently we can build CPython with just a C compiler. A language change is not a minor detail. Sturla

Basically agreeing with what's been said already: IPython is an application that has Python (and some other things) as a dependency. So is IDLE. Python itself should ideally not be bundled with any applications -- it's a historical accident that IDLE is in the stdlib. Of course there should be a basic command prompt, but I think that the existing one based on GNU readline is fine for that purpose. -- --Guido van Rossum (python.org/~guido)

On 5 July 2015 at 19:26, Guido van Rossum <guido@python.org> wrote:
This does raise an interesting question though: should we perhaps update the "getting & installing" parts of https://docs.python.org/3/using/index.html to cover more of the available options? For users interested in Python for research and data analysis, for example, the SciPy page on installing Python would likely be a better starting point than our upstream guide: http://www.scipy.org/install.html Similarly, someone looking for a more sophisticated IDE than IDLE would do well to explore PyCharm, Komodo, Wingware, Visual Studio Community Edition, or one of the other options listed at https://wiki.python.org/moin/IntegratedDevelopmentEnvironments It may also be worth our while to update https://docs.python.org/3/tutorial/index.html and/or https://docs.python.org/3/tutorial/interpreter.html to include a cross-reference to the usage guide for more detailed installation instructions (it took me a moment to remember where the platform specific installation guides were myself, so it wouldn't surprise me if someone reading the tutorial with no other context also had trouble finding them). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

On Sun, Jul 5, 2015 at 5:01 AM Nick Coghlan <ncoghlan@gmail.com> wrote:
I think we should. The only reason anyone uses IDLE is that they found it as one of the included batteries (sometimes referred to by tutorials) and misinterpret that to think that it is good. It works, but it is mostly no frills with some annoying limitations (see the bug tracker). I doubt you'll find any core developers using IDLE to get work done. [this is where someone will pipe up and respond "hey!"]
+1 -gps

On 7/5/2015 6:54 PM, Gregory P. Smith wrote:
Is that an invitation? It is true that I started using Idle because it came with CPython, and kept using it because it is much, much, much better than using Notepad + python.exe in Windows Command Prompt, and now because it has some 'frills' that I, as a Python-only programmer, consider essention. Two main ones are: 1. Running a file from an editor a. with one button press b. with immediate syntax check (without starting external process) c. with minimal startup time (inviting repeated testing) d. in -i mode (allowing post-run experiments) e. in a shell that understands tracebacks enough to parse out file and line information, open the file, and jump to the line (rt click in Idle). 2. Grep (Find in Files) that runs from the editor a. defaulting to the directory of the file being edited b. putting output in another edit window c. with ability to easily open the file and jump to the line of hits. Shell and editor aside, it has occurred to be that it would be nice to have a tutorial-notebook-interactive-doc system of some sort that runs on tkinter and comes with the stdlib. Thinking about it more, I believe that something basic that alternated between canned text, pre-written code, and a live prompt, could be added to the Idle Shell. -- Terry Jan Reedy

On 6 July 2015 at 10:29, Terry Reedy <tjreedy@udel.edu> wrote:
It's worth looking at some of the features of PyCharm Educational Edition in that regard. Tangentially related, something I would *love* to see at some point is IPython's "obj?" and "obj??" syntax extensions elevated to formal Python Enhancement Proposals. Concept sketch: obj? calls sys.__dochook__(obj) obj?? calls sys.__helphook__(obj) Default implementations: def __dochook__(obj): import pydoc print(pydoc.getdoc(obj)) def __helphook__(obj): help(obj) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

On Jul 5, 2015 9:29 PM, "Nick Coghlan" <ncoghlan@gmail.com> wrote:
On 6 July 2015 at 10:29, Terry Reedy <tjreedy@udel.edu> wrote:
Shell and editor aside, it has occurred to be that it would be nice to
have
PyCharm is great (and now has IPython Notebook integration) Spyder is great, and FOSS, has an IPython drawer (and now has pandas.DataFrame display support). Possibly more relevant for education and learning are the "test until green" features of a given IDE (or vim `:make`)
* [ ] ? and ?? support would be great (though you can also just define functions in e.g .pythonrc) * Python readline tab completion (without IDLE or IPython or bpython): http://pymotw.com/2/rlcompleter/ ... I'm sure there's a reason why this is not the default

On 6 July 2015 at 14:23, Wes Turner <wes.turner@gmail.com> wrote:
It's been the default since 3.4: https://docs.python.org/dev/whatsnew/3.4.html#sys Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

That would be great, there are (some) things we should to be careful with. prevent `obj?` in a loop is the first I can thing of. I know there are other gotchas. The second things, it would be nice to allow object to return different mimetype for their help, which I would like to see in the spec of __dochook__ and __helphook__ and not as a convention that depends on the shell you use. One of the things we want to play with in IPython (and in particular notebook), is to have run-able docs (yes with all the security concern that could imply), for which we would need richer data. I also want to point out that `?` also allow to do search for object name matching regex, which I like too. In [7]: ?numpy.*str* numpy.__str__ numpy.add_docstring numpy.array2string numpy.array_str numpy.datetime_as_string numpy.fromstring numpy.set_string_function numpy.str numpy.str0 numpy.str_ numpy.string_ -- M On Mon, Jul 6, 2015 at 12:09 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:

what do you think about this project? https://github.com/asweigart/idle-reimagined

On 4 July 2015 at 18:56, Todd <toddrjen@gmail.com> wrote:
Software Carpentry already recommend the IPython Notebook to research scientists and data analysts learning Python (understandably so, since IPython Notebook is built by and for research scientists and data analysts). The needs for programming education are different, and the Raspberry Pi Foundation are starting looking at the available options in that space (including asking the question of whether or not there should be "Python for Education" edition that bundles additional third party libraries that don't make sense to include in the default installation. There's certainly scope for improving IDLE itself (within the constraints of "no dependencies outside the standard library"), but part of that includes refactoring IDLE to make it easier to work on and test. idle-dev is the appropriate list to find out more about the options there. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

I just want to add the the IPython team has no plan to request, or try to have IPython to be incorporated into standard library. We are happy and our users seem to be happy with it as an external package. This also allow us to do quicker releases, changes our dependencies (and our dependencies are growing), basically leave us more freedom. It would also be funny to require nodejs to build the Javascript that would need to be shipped for the notebook... And despite some people loving IPython and the Notebook, we are the first to admit that the notebook is not the best tool for everything. We are still using vi/emacs/nano/ed/$EDITOR/$IDE to program, and it is better suited for a lot of tasks. Where notebook files are hard to edit in text editor[1]. That being said we would love to get some IPython-shell feature in the interactive python shell, like numbered prompt by default, and a way to have the help syntax with `?` easier to hook into, instead of doing reg-ex transform on the input. With the more an more increasing pain of deadline on window we are also looking into pypython[2] and enable it by default in the IPython shell, there are a lot of really good improvement ideas for the plain shell that can be taken from that too. -- M [1] Yes I am aware of IPymd, but still you cannot break a class in between cells. [2] https://github.com/jonathanslenders/ptpython <https://github.com/jonathanslenders/ptpython>

On Sat, Jul 4, 2015 at 12:11 PM, Matthias Bussonnier < bussonniermatthias@gmail.com> wrote:
Pros: * already installed * (C)Python community review Cons: * CPython release schedule * CPython dependencies do not include the IPython dependencies * CPython Makefile * https://hg.python.org/cpython/file/tip/Lib * Core Developers For the hypothetical case that IPython and dependencies all decide to migrate their projects to the CPython source tree: Docs: https://docs.python.org/devguide/stdlibchanges.html#adding-a-new-module Docs: https://docs.python.org/devguide/stdlibchanges.html#adding-to-a-pre-existing...
It would also be funny to require nodejs to build the Javascript that would need to be shipped for the notebook...
And TypeScript.
!cp io.log scriptname.py %ed ./scriptname.py
%doctest_mode

On Sat, Jul 4, 2015 at 8:26 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:
* http://software-carpentry.org/blog/2012/03/the-ipython-notebook.html * http://software-carpentry.org/blog/2013/03/using-notebook-as-a-teaching-tool... * https://software-carpentry.org/v5/novice/python/06-cmdline.html (IPython)
I believe it's possible to run Docker and LXC on a Raspberry Pi (ARM arch). https://github.com/ipython/ipython/wiki/Install:-Docker * IPython, Scipy Stack (CPython, Anaconda conda packages, pip packages) https://wrdrd.com/docs/consulting/education-technology#jupyter-and-learning * There are extensions to include which packages/modules are/were installed/necessary for a given notebook (watermark, version_information) #jupyter-and-reproducibility
Some of my first lines of Python were in IDLE (with diveintopython 2).

Todd <toddrjen@gmail.com> wrote:
It will not be possible because of this: https://jupyter.org Having Jupyter in the Python standard library would screw over the Julia and R users. Also, more extensive Python distros like Anaconda and Enthought Canopy include IPython/Jupyter by default. I think it is more important to start to direct users to select these than to include Jupyter in the standard lib. This is particularly important because of the growing number of essential packages that are not in the standard lib (e.g. NumPy, Cython, Numba, matplotlib, wxPython, Twisted, pymq, Sqalchemy, etc.) and the complex package dependencies. Another question is whether python.org should provide links to these installers, or even maintain a similar Python stack with a package manager (I am not sure if pip can handle all the complexities sufficient). Sturla

Well they still have to install CPython to install Jupyter and even Python3 if they want multi-user... so I’m not sure that would “screw” them. (or I don’t get why you mean by screw them).
One possible, simpler thing would be to ship a minimal python kernel [1] that ‘only’ requires PyZMQ. Though, now that pip “Just works"[2], I ‘m not sure it is worth either. -- M [2]: offer subject to conditions [1]: https://github.com/dsblank/simple_kernel/blob/master/simple_kernel.py <https://github.com/dsblank/simple_kernel/blob/master/simple_kernel.py> # simple_kernel.py # by Doug Blank <doug.blank@gmail.com> # # This sample kernel is meant to be able to demonstrate using zmq for # implementing a language backend (called a kernel) for IPython. It is # written in the most straightforward manner so that it can be easily # translated into other programming languages. It doesn't use any code # from IPython, but only standard Python libraries and zmq. # # It is also designed to be able to run, showing the details of the # message handling system.

On 04/07/15 22:16, Matthias Bussonnier wrote:
Release schedules and development would be swallowed into Python. If they need a bugfix for Julia or R, they have to wait for the next release of Python. There would also be Julia and R related issues in the CPython bugtracker.
One possible, simpler thing would be to ship a minimal python kernel [1] that ‘only’ requires PyZMQ.
Only? This would require a C++ compiler. Currently we can build CPython with just a C compiler. A language change is not a minor detail. Sturla

Basically agreeing with what's been said already: IPython is an application that has Python (and some other things) as a dependency. So is IDLE. Python itself should ideally not be bundled with any applications -- it's a historical accident that IDLE is in the stdlib. Of course there should be a basic command prompt, but I think that the existing one based on GNU readline is fine for that purpose. -- --Guido van Rossum (python.org/~guido)

On 5 July 2015 at 19:26, Guido van Rossum <guido@python.org> wrote:
This does raise an interesting question though: should we perhaps update the "getting & installing" parts of https://docs.python.org/3/using/index.html to cover more of the available options? For users interested in Python for research and data analysis, for example, the SciPy page on installing Python would likely be a better starting point than our upstream guide: http://www.scipy.org/install.html Similarly, someone looking for a more sophisticated IDE than IDLE would do well to explore PyCharm, Komodo, Wingware, Visual Studio Community Edition, or one of the other options listed at https://wiki.python.org/moin/IntegratedDevelopmentEnvironments It may also be worth our while to update https://docs.python.org/3/tutorial/index.html and/or https://docs.python.org/3/tutorial/interpreter.html to include a cross-reference to the usage guide for more detailed installation instructions (it took me a moment to remember where the platform specific installation guides were myself, so it wouldn't surprise me if someone reading the tutorial with no other context also had trouble finding them). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

On Sun, Jul 5, 2015 at 5:01 AM Nick Coghlan <ncoghlan@gmail.com> wrote:
I think we should. The only reason anyone uses IDLE is that they found it as one of the included batteries (sometimes referred to by tutorials) and misinterpret that to think that it is good. It works, but it is mostly no frills with some annoying limitations (see the bug tracker). I doubt you'll find any core developers using IDLE to get work done. [this is where someone will pipe up and respond "hey!"]
+1 -gps

On 7/5/2015 6:54 PM, Gregory P. Smith wrote:
Is that an invitation? It is true that I started using Idle because it came with CPython, and kept using it because it is much, much, much better than using Notepad + python.exe in Windows Command Prompt, and now because it has some 'frills' that I, as a Python-only programmer, consider essention. Two main ones are: 1. Running a file from an editor a. with one button press b. with immediate syntax check (without starting external process) c. with minimal startup time (inviting repeated testing) d. in -i mode (allowing post-run experiments) e. in a shell that understands tracebacks enough to parse out file and line information, open the file, and jump to the line (rt click in Idle). 2. Grep (Find in Files) that runs from the editor a. defaulting to the directory of the file being edited b. putting output in another edit window c. with ability to easily open the file and jump to the line of hits. Shell and editor aside, it has occurred to be that it would be nice to have a tutorial-notebook-interactive-doc system of some sort that runs on tkinter and comes with the stdlib. Thinking about it more, I believe that something basic that alternated between canned text, pre-written code, and a live prompt, could be added to the Idle Shell. -- Terry Jan Reedy

On 6 July 2015 at 10:29, Terry Reedy <tjreedy@udel.edu> wrote:
It's worth looking at some of the features of PyCharm Educational Edition in that regard. Tangentially related, something I would *love* to see at some point is IPython's "obj?" and "obj??" syntax extensions elevated to formal Python Enhancement Proposals. Concept sketch: obj? calls sys.__dochook__(obj) obj?? calls sys.__helphook__(obj) Default implementations: def __dochook__(obj): import pydoc print(pydoc.getdoc(obj)) def __helphook__(obj): help(obj) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

On Jul 5, 2015 9:29 PM, "Nick Coghlan" <ncoghlan@gmail.com> wrote:
On 6 July 2015 at 10:29, Terry Reedy <tjreedy@udel.edu> wrote:
Shell and editor aside, it has occurred to be that it would be nice to
have
PyCharm is great (and now has IPython Notebook integration) Spyder is great, and FOSS, has an IPython drawer (and now has pandas.DataFrame display support). Possibly more relevant for education and learning are the "test until green" features of a given IDE (or vim `:make`)
* [ ] ? and ?? support would be great (though you can also just define functions in e.g .pythonrc) * Python readline tab completion (without IDLE or IPython or bpython): http://pymotw.com/2/rlcompleter/ ... I'm sure there's a reason why this is not the default

On 6 July 2015 at 14:23, Wes Turner <wes.turner@gmail.com> wrote:
It's been the default since 3.4: https://docs.python.org/dev/whatsnew/3.4.html#sys Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

That would be great, there are (some) things we should to be careful with. prevent `obj?` in a loop is the first I can thing of. I know there are other gotchas. The second things, it would be nice to allow object to return different mimetype for their help, which I would like to see in the spec of __dochook__ and __helphook__ and not as a convention that depends on the shell you use. One of the things we want to play with in IPython (and in particular notebook), is to have run-able docs (yes with all the security concern that could imply), for which we would need richer data. I also want to point out that `?` also allow to do search for object name matching regex, which I like too. In [7]: ?numpy.*str* numpy.__str__ numpy.add_docstring numpy.array2string numpy.array_str numpy.datetime_as_string numpy.fromstring numpy.set_string_function numpy.str numpy.str0 numpy.str_ numpy.string_ -- M On Mon, Jul 6, 2015 at 12:09 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:

what do you think about this project? https://github.com/asweigart/idle-reimagined
participants (9)
-
Alan Cristhian
-
Gregory P. Smith
-
Guido van Rossum
-
Matthias Bussonnier
-
Nick Coghlan
-
Sturla Molden
-
Terry Reedy
-
Todd
-
Wes Turner