Run Windows commands from Python console

Rick Johnson rantingrickjohnson at gmail.com
Tue Sep 5 22:48:24 EDT 2017


Terry Reedy wrote:
> Rick Johnson wrote:

[...] 

> > When i'm away from an editor (like IDLE, for instance),
> > one of the features i miss most is the ability to right
> > click the line of the exception message (you know, the one
> > that includes the offending line number and offending
> > script filepath), and choose "open script for editing"
> > from a contextual menu, which will open the script and
> > automatically scroll down to the offending line for me.
> > Ahhh, efficient bliss.
> 
> 'Goto file/line' also works on the grep/find-in-files
> Output Window. I must have used this about 30 times in 8
> outputs tonight try to track down bugs in a proposed IDLE
> patch. There were no tracebacks, just thinkgs not working.

Yes, the find-in-files feature gets a lot of usage from me
as well, when i'm "IDLE'ing" ;-)

> I plan to make it a bit faster by moving the option to the
> top of the menu.

Speaking of "end-user interface customizations"... one
feature that i have yet to find, in any modern GUI, is the
ability to move menu commands around at mere whim. I find
that many times, devs don't put enough thought into these
things.

Another menuing feature that might be helpful, is a "recent
commands" listing, that will list a handful of the most
recently used commands, and keep them handy for quick
access.

One of the nice (current) features of Tkinter menus (that i
sometimes miss on my windows box!) is the ability to "tear-
off" a menu cascade and use it as a sort of "pseudo tool
bar". Of course, the tear-off feature may be limited, as you
are confined to dealing with textual commands, as opposed to
space-saving icons, but for those who have an aversion to
Rachmaninoff-style key chording, a helpful feature
nonetheless!

> I have thought about making it even faster by not having to
> use the context menu -- just click, or maybe double click,
> and the jump happens.  What do you think?

I think that would be a great idea for the find-in-files
output window, since after all, it is a single purpose tool.
I myself have a stand-alone grep tool with a "double click
to edit" event bound, and i do find the click (one step) to
be far more efficient than a contextual menu (two steps).
Since, when you open a contextual menu, there is that
moment of distraction while you search for the correct
command.

However, i'm not sure if dynamic mouse events in IDLE's
pyshell (aka: "REPL window") are a good idea, as an
accidental click in an exception dump would cause surprise
windows to pop up, and could be confusing to noobs. What is
your opinion on this?

Additionally, in the find-in-files window, it might be
helpful to also add a short message (using a tk.Label
perhaps?) above the "output area" (which i assume is a
tk.Text?), informing the user to "Double-click a path to
edit with IDLE" -- or something informative like that.



More information about the Python-list mailing list