Terry J. Reedy added the comment:

0. My general interest is in running external programs and in particular, for 
this issue, python modules intended to be run as main. Some other scripts I 
would like to be able to easily launch from Idle include 
List/test.test_idle.py, Tools/Scripts/patchcheck.py, and a possible 
'idle_tour.py' (in progress) that would be a live demo/tutorial of some Idle 
widgets and functions. I would like the list to be user-configurable for other 
choices.

1. As with any python script, turtledemo can be run now, without modification, 
in a separate process, asynchronously, from within idle, by loading the file 
into an editor window and selecting Run / Run Module or hitting F5. 
Communication and cleanup issues are already solved. Having output appear in 
the Shell window obviates the need for a separate console window to receive 
output, keeps it visible even after the external process quits. One thing that 
remains impossible is to run two separate modules at the same time.

A possible inplementation of 'easy to launch' would be to load turtledemo.py 
into an editor window and generate a '<<run-module>>' event.

This, of course, does more than is needed and has the danger of a user 
accidentally overwriting the original module code. An alternative would be a 
stripped down version of ScriptBinding.ScriptBinding._run_module_event.

2. This feature should be implemented as an extension rather than being 'baked' 
into Idle. Run-module itself is an extension (ScriptBinding.py), as are several 
other functions (see config-extensions.def). A possible name would be 
'external_module.py'

An advantage of an extension is that it can be turned off if someone, such as a 
college course instructor, does not like it present. This change could be made 
before considering point 1.

I would like to have one extension that could handle multiple external modules 
listed in the config entry. After reading config-bindings.def and some of the 
extension files, especially RstripExtension.py, I believe this is possible. 
However, I would expect to add this after there is a patch just for turtledemo.

3. If Run were on the menu of Shell windows, that would be the appropriate 
place for 'run external module' as opposed 'run editor module'. This would be 
especially true with multiple entries.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17172>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to