From taleinat at gmail.com Fri Nov 1 18:37:34 2019 From: taleinat at gmail.com (Tal Einat) Date: Sat, 2 Nov 2019 00:37:34 +0200 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar Message-ID: Hi all, Following up the successful addition of line numbers for editor windows, we're considering moving shell prompts to a similar side-bar instead of having them inline. *I'd love to hear opinions about this from more active users!* This is a PR ready, I'm attaching a screenshot to make it easy to get a feel for what is proposed. Please give it a look and let us know what you think here or on the b.p.o. issue . - Tal Einat -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: screenshot.png Type: image/png Size: 17999 bytes Desc: not available URL: From guido at python.org Fri Nov 1 18:45:30 2019 From: guido at python.org (Guido van Rossum) Date: Fri, 1 Nov 2019 15:45:30 -0700 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar In-Reply-To: References: Message-ID: If I?d known that was possible I?d have done that 2 years ago. So +1. On Fri, Nov 1, 2019 at 15:38 Tal Einat wrote: > Hi all, > > Following up the successful addition of line numbers for editor windows, > we're considering moving shell prompts to a similar side-bar instead of > having them inline. > > *I'd love to hear opinions about this from more active users!* > > This is a PR ready, I'm attaching a screenshot to make it easy to get a > feel for what is proposed. Please give it a look and let us know what you > think here or on the b.p.o. issue . > > - Tal Einat > _______________________________________________ > IDLE-dev mailing list > IDLE-dev at python.org > https://mail.python.org/mailman/listinfo/idle-dev > -- --Guido (mobile) -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.roberge at gmail.com Fri Nov 1 19:10:14 2019 From: andre.roberge at gmail.com (=?UTF-8?Q?Andr=C3=A9_Roberge?=) Date: Fri, 1 Nov 2019 20:10:14 -0300 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar In-Reply-To: References: Message-ID: Yes, most definitely! On Fri, Nov 1, 2019 at 7:37 PM Tal Einat wrote: > Hi all, > > Following up the successful addition of line numbers for editor windows, > we're considering moving shell prompts to a similar side-bar instead of > having them inline. > > *I'd love to hear opinions about this from more active users!* > > This is a PR ready, I'm attaching a screenshot to make it easy to get a > feel for what is proposed. Please give it a look and let us know what you > think here or on the b.p.o. issue . > > - Tal Einat > _______________________________________________ > IDLE-dev mailing list > IDLE-dev at python.org > https://mail.python.org/mailman/listinfo/idle-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjreedy at udel.edu Sat Nov 2 00:24:36 2019 From: tjreedy at udel.edu (Terry Reedy) Date: Sat, 2 Nov 2019 00:24:36 -0400 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar In-Reply-To: References: Message-ID: On 11/1/2019 6:45 PM, Guido van Rossum wrote: > If I?d known that was possible I?d have done that 2 years ago. So +1. Did you mean 20 years ago (1999), when (AFAIK) you submitted the first patches? In any case, I appreciate the quick positive response from you and Andr?. I posted the idea for this over 5 years ago and a majority of people, including the two commenting on the current issue, https://bugs.python.org/issue37903 have not been as enthusiastic (as in don't seem to have gotten why it is a great idea). > On Fri, Nov 1, 2019 at 7:37 PM Tal Einat wrote: >> I'm attaching a screenshot to make it easy to get a feel for what is proposed. I should have mocked this years ago in my post to https://bugs.python.org/issue7676 As it is, the screenshot does not yet show 8-column tab indents replaced with 4-space indents. (An immediate follow-on patch.) The following better shows this part of the goal. >>>|print("Hello, world") |Hello, world! >>>|if True: ...| if "Let's get rid of 8-space tabs!": ...| print("This indentation is just right.") ...| |This indentation is just right. where the strength and visibility of the vertical line depends on the OS widgets and the background colors of the sidebar and text box. I have more recently tried to (somewhat conservatively) 'reimagine' how the IDLE's shell should operate, following these principles: 1. User code should be executed properly. AFAIK, done. 2. User code should be formatted properly (as in the editor). This is not true now but will be with this change and the follow-up indent change. 3. Interaction should be made as easy as possible, even if it means looking or operating a bit differently from the standard REPL. IDLE already does this somewhat, and posted ideas for follow-up changes to https://bugs.python.org/issue37892 -- Terry Jan Reedy From guido at python.org Sat Nov 2 00:58:27 2019 From: guido at python.org (Guido van Rossum) Date: Fri, 1 Nov 2019 21:58:27 -0700 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar In-Reply-To: References: Message-ID: On Fri, Nov 1, 2019 at 9:24 PM Terry Reedy wrote: > On 11/1/2019 6:45 PM, Guido van Rossum wrote: > > If I?d known that was possible I?d have done that 2 years ago. So +1. > > Did you mean 20 years ago (1999), when (AFAIK) you submitted the first > patches? > Yes. Stupid phone "keyboard". > In any case, I appreciate the quick positive response from you and > Andr?. I posted the idea for this over 5 years ago and a majority of > people, including the two commenting on the current issue, > https://bugs.python.org/issue37903 > have not been as enthusiastic (as in don't seem to have gotten why it is > a great idea). > It is obviously a great idea if you ever want to copy a multi-line statement from the IDLE shell to a module, since the prompt doesn't get in the way (and you will be able to use spaces instead of tabs for indentation -- apart from a few oddballs, everyone uses four spaces). > > On Fri, Nov 1, 2019 at 7:37 PM Tal Einat wrote: > > >> I'm attaching a screenshot to make it easy to get a feel for what is > proposed. > > I should have mocked this years ago in my post to > https://bugs.python.org/issue7676 > > As it is, the screenshot does not yet show 8-column tab indents replaced > with 4-space indents. (An immediate follow-on patch.) The following > better shows this part of the goal. > > >>>|print("Hello, world") > |Hello, world! > >>>|if True: > ...| if "Let's get rid of 8-space tabs!": > ...| print("This indentation is just right.") > ...| > |This indentation is just right. > > where the strength and visibility of the vertical line depends on the OS > widgets and the background colors of the sidebar and text box. > What I said. > I have more recently tried to (somewhat conservatively) 'reimagine' how > the IDLE's shell should operate, following these principles: > 1. User code should be executed properly. AFAIK, done. > 2. User code should be formatted properly (as in the editor). This is > not true now but will be with this change and the follow-up indent change. > 3. Interaction should be made as easy as possible, even if it means > looking or operating a bit differently from the standard REPL. IDLE > already does this somewhat, and posted ideas for follow-up changes to > https://bugs.python.org/issue37892 > Probably the most popular alternate REPL is IPython (whether standalone or in Jupyter Notebook) which is way different from the standard REPL anyway. So you're in good company wanting a different REPL in IDLE. In issue 37903, RH appears to be requiring support for doctests. (Interestingly, in issue 7676 he wishes the IDLE shell wouldn't use tabs, which you're going to support.) I'm a little confused by his comments about doctests. IMO copying from a "doctest" in the docs to the shell is not affected -- the problem there is purely that you have to work hard to avoid also copying the ">>>" and (especially) "..." prompts into the shell. That seems to me to be the main thing people would do with doctests, and it's unaffected. It's true that recreating a doctest from an IDLE shell session is a little harder -- but a nice fallback is to use the python binary itself, which has the exact behavior you'd want. So I don't see this as a reason not to backport. (This also seems pretty niche. I don't know if he can back up his claim that doctests have become more popular.) I also don't see a reason to start supporting sys.ps1/ps2 -- I copied that feature rather mindlessly from the UNIX shell 30 years ago, and probably wouldn't have done it the same way today. (The only useful thing to do here might be to set sys.ps2="", to make copying from a shell window a little less painful. But your solution solves that much more elegantly.) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jn.ml.pyth.93 at letterboxes.org Sat Nov 2 05:52:58 2019 From: jn.ml.pyth.93 at letterboxes.org (Jeremy Nicoll) Date: Sat, 02 Nov 2019 09:52:58 +0000 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar In-Reply-To: References: Message-ID: <1c741401-d505-4add-be10-811dbb5ff836@www.fastmail.com> On Fri, 1 Nov 2019, at 22:37, Tal Einat wrote: > Hi all, > > Following up the successful addition of line numbers for editor > windows, we're considering moving shell prompts to a similar side-bar > instead of having them inline. > > *I'd love to hear opinions about this from more active users!* +1, from me too. (I mainly lurk here). -- Jeremy Nicoll - my opinions are my own. From taleinat at gmail.com Sat Nov 2 06:28:47 2019 From: taleinat at gmail.com (Tal Einat) Date: Sat, 2 Nov 2019 12:28:47 +0200 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar In-Reply-To: References: Message-ID: Thanks for expressing your opinions on this, Guido, Andr? and Jeremy, and I'm happy that you all are in support! On Sat, Nov 2, 2019 at 6:58 AM Guido van Rossum wrote: > > In issue 37903, RH appears to be requiring support for doctests. > (Interestingly, in issue 7676 he wishes the IDLE shell wouldn't use tabs, > which you're going to support.) I'm a little confused by his comments about > doctests. IMO copying from a "doctest" in the docs to the shell is not > affected -- the problem there is purely that you have to work hard to avoid > also copying the ">>>" and (especially) "..." prompts into the shell. That > seems to me to be the main thing people would do with doctests, and it's > unaffected. It's true that recreating a doctest from an IDLE shell session > is a little harder -- but a nice fallback is to use the python binary > itself, which has the exact behavior you'd want. So I don't see this as a > reason not to backport. (This also seems pretty niche. I don't know if he > can back up his claim that doctests have become more popular.) > My reading of Raymond's comment related to doctests was also that he was worried about losing the ability to create doctests simply by copy/pasting from an IDLE shell session. ISTM that moving the prompts to a side-bar would make it only slightly more difficult, though perhaps significantly difficult for novices. If this becomes a common request we could simply add a "copy for doctest" context menu option - I'd be happy to implement that myself. - Tal -------------- next part -------------- An HTML attachment was scrubbed... URL: From beni.cherniavsky at gmail.com Sat Nov 2 18:40:21 2019 From: beni.cherniavsky at gmail.com (Beni Cherniavsky-Paskin) Date: Sun, 3 Nov 2019 00:40:21 +0200 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar In-Reply-To: References: Message-ID: Note that unlike terminal, multi-line commands in IDLE are already not copyable into doctests - one needs to manually add `... ` continuation prompts, which is O(n-1) manual work per command; additionally having to insert `>>> ` ups that to O(n) which is not much worse. In an ideal world, it would behave as an html table, allowing dragging mouse from sidebar into editing area to select both columns together. Not sure that's possible in Tk. On Sat, 2 Nov 2019, 12:29 Tal Einat, wrote: > Thanks for expressing your opinions on this, Guido, Andr? and Jeremy, and > I'm happy that you all are in support! > > On Sat, Nov 2, 2019 at 6:58 AM Guido van Rossum wrote: > >> >> In issue 37903, RH appears to be requiring support for doctests. >> (Interestingly, in issue 7676 he wishes the IDLE shell wouldn't use tabs, >> which you're going to support.) I'm a little confused by his comments about >> doctests. IMO copying from a "doctest" in the docs to the shell is not >> affected -- the problem there is purely that you have to work hard to avoid >> also copying the ">>>" and (especially) "..." prompts into the shell. That >> seems to me to be the main thing people would do with doctests, and it's >> unaffected. It's true that recreating a doctest from an IDLE shell session >> is a little harder -- but a nice fallback is to use the python binary >> itself, which has the exact behavior you'd want. So I don't see this as a >> reason not to backport. (This also seems pretty niche. I don't know if he >> can back up his claim that doctests have become more popular.) >> > > My reading of Raymond's comment related to doctests was also that he was > worried about losing the ability to create doctests simply by copy/pasting > from an IDLE shell session. ISTM that moving the prompts to a side-bar > would make it only slightly more difficult, though perhaps significantly > difficult for novices. If this becomes a common request we could simply add > a "copy for doctest" context menu option - I'd be happy to implement that > myself. > > - Tal > _______________________________________________ > IDLE-dev mailing list > IDLE-dev at python.org > https://mail.python.org/mailman/listinfo/idle-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From taleinat at gmail.com Mon Nov 4 02:19:38 2019 From: taleinat at gmail.com (Tal Einat) Date: Mon, 4 Nov 2019 09:19:38 +0200 Subject: [Idle-dev] IDLE shell: Moving prompts to a side-bar In-Reply-To: References: Message-ID: On Sun, Nov 3, 2019 at 7:41 PM Beni Cherniavsky-Paskin < beni.cherniavsky at gmail.com> wrote: > Note that unlike terminal, multi-line commands in IDLE are already not > copyable into doctests - one needs to manually add `... ` continuation > prompts, which is O(n-1) manual work per command; additionally having to > insert `>>> ` ups that to O(n) which is not much worse. > Indeed. > In an ideal world, it would behave as an html table, allowing dragging > mouse from sidebar into editing area to select both columns together. Not > sure that's possible in Tk. > First of all, that *is* possible, but it would be hard. Second, I was thinking of adding support for selecting a range of lines by dragging on the sidebar, similar to the new editor window behavior with line numbers (try it!). It *would* be possible to make this also highlight the sidebar prompts as selected, and include them when copying. This is very similar to the above, actually. Even simpler would be adding a "copy as doctest" context-menu (right-click) option, which wouldn't require users to discover selection using the sidebar. IMO this is more obvious and easy to discover, and so better suited for IDLE. - Tal -------------- next part -------------- An HTML attachment was scrubbed... URL: From nuno_ferreira at orange.fr Sat Nov 23 16:14:30 2019 From: nuno_ferreira at orange.fr (Nuno Ferreira) Date: Sat, 23 Nov 2019 22:14:30 +0100 Subject: [Idle-dev] Fwd: [Tutor] Help needed configuring IDLE References: <31a6e9f5-849a-39a3-738b-ea46fab0c28a@wichmann.us> Message-ID: Hello, Trying to use Python (3.8) + IDLE on my MAC (10.13.6 High Sierra). Would appreciate help on this very basic issue : When I write a script and save it, IDLE wants by default to save it in ~/Documents (as listed by File > Path Browser). Is there a way to change this default location to something different ? The answers received so far from the Tutor maillist are somewhat helpful but I am still looking for more specific help, if available. Can you help ? Thanks in advance. > Begin forwarded message: > > From: Mats Wichmann > Subject: Re: [Tutor] Help needed configuring IDLE > Date: 23 November 2019 at 19:25:09 GMT+1 > To: tutor at python.org > > On 11/23/19 11:10 AM, Alan Gauld via Tutor wrote: >> On 23/11/2019 16:28, Nuno Ferreira wrote: >>> Trying to use Python + IDLE on my MAC. >>> When I write a script and save it, IDLE wants by default to save it in ~/Documents >> I had a look at my Linux IDLE configuration files and I can't >> see any way to change it. FWIW, On my system it targets my >> home directory (~) rather than Documents (~/Documents). >> You could try asking on the IDLE-dev mailing list, >> these guys are pretty good at responding to these kinds >> of issues. > > I recall from past times that you have to actually edit the code of IDLE. I don't even know where at this point; there's someplace it figures out a path by doing "expanduser" if I haven't forgotten the logic - the difference in paths between Linux and Mac is just what expanduser works out to. > > [sorry, from memory] > > > > > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2019-11-23 at 22.09.40.png Type: image/png Size: 28446 bytes Desc: not available URL: From tjreedy at udel.edu Sun Nov 24 16:22:58 2019 From: tjreedy at udel.edu (Terry Reedy) Date: Sun, 24 Nov 2019 16:22:58 -0500 Subject: [Idle-dev] Fwd: [Tutor] Help needed configuring IDLE In-Reply-To: References: <31a6e9f5-849a-39a3-738b-ea46fab0c28a@wichmann.us> Message-ID: <13fe9fbf-3d7b-0e52-539b-b13b63f86e2b@udel.edu> On 11/23/2019 4:14 PM, Nuno Ferreira wrote: > When I write a script and save it, IDLE wants by default to save it in > ~/Documents (as listed by File > Path Browser). Is there a way to change > this default location to something different ? AFAIK, the following are true. Every window that can be saved has a default save directory. When you open an existing file, the default is the directory it came from. When you save a file, it is the directory you save in. When you open a new file, it is the default directory of existing active window. So you set the initial default save location for a file by which window you use to open it. I don't want to change and of the above. The default save location for unsaved Shell windows, an windows opened from them, depends on the OS and how it is installed. For me, on Windows, it is the directory containing the python?.exe or pythonw.exe running IDLE. From the screenshot, you are working on macOS, and there the default default, ~/Documents, is better. It has been proposed to match that on other systems. Making this default default user configurable would be a further enhancement. -- Terry Jan Reedy From nuno_ferreira at orange.fr Sun Nov 24 17:06:12 2019 From: nuno_ferreira at orange.fr (Nuno Ferreira) Date: Sun, 24 Nov 2019 23:06:12 +0100 Subject: [Idle-dev] Fwd: [Tutor] Help needed configuring IDLE In-Reply-To: <13fe9fbf-3d7b-0e52-539b-b13b63f86e2b@udel.edu> References: <31a6e9f5-849a-39a3-738b-ea46fab0c28a@wichmann.us> <13fe9fbf-3d7b-0e52-539b-b13b63f86e2b@udel.edu> Message-ID: Hi, Thanks for the clarification. Regards. > On 24 Nov 2019, at 22:22, Terry Reedy wrote: > > On 11/23/2019 4:14 PM, Nuno Ferreira wrote: > >> When I write a script and save it, IDLE wants by default to save it in ~/Documents (as listed by File > Path Browser). Is there a way to change this default location to something different ? > > AFAIK, the following are true. Every window that can be saved has a default save directory. When you open an existing file, the default is the directory it came from. When you save a file, it is the directory you save in. When you open a new file, it is the default directory of existing active window. So you set the initial default save location for a file by which window you use to open it. I don't want to change and of the above. > > The default save location for unsaved Shell windows, an windows opened from them, depends on the OS and how it is installed. For me, on Windows, it is the directory containing the python?.exe or pythonw.exe running IDLE. From the screenshot, you are working on macOS, and there the default default, ~/Documents, is better. It has been proposed to match that on other systems. Making this default default user configurable would be a further enhancement. > > -- > Terry Jan Reedy > From beni.cherniavsky at gmail.com Mon Nov 25 05:07:50 2019 From: beni.cherniavsky at gmail.com (Beni Cherniavsky-Paskin) Date: Mon, 25 Nov 2019 12:07:50 +0200 Subject: [Idle-dev] Fwd: [Tutor] Help needed configuring IDLE In-Reply-To: <13fe9fbf-3d7b-0e52-539b-b13b63f86e2b@udel.edu> References: <31a6e9f5-849a-39a3-738b-ea46fab0c28a@wichmann.us> <13fe9fbf-3d7b-0e52-539b-b13b63f86e2b@udel.edu> Message-ID: ??, 24 ????. 2019 ?. ? 23:23, Terry Reedy : > The default save location for unsaved Shell windows, an windows opened > from them, depends on the OS and how it is installed. For me, on > Windows, it is the directory containing the python?.exe or pythonw.exe > running IDLE. From the screenshot, you are working on macOS, and there > the default default, ~/Documents, is better. It has been proposed to > match that on other systems. Making this default default user > configurable would be a further enhancement. > > At least on Linux, when I run `idle2` / `idle3` from a terminal, it seems the default location (for Shell window and windows opened from it) is the current working directory it was launched from. So try launching idle from the directory you want to use? I suppose the "how it is installed" defaults Terry described above are when launching it from graphical menu / shortcut. I know Windows start menu shortcuts have editable working directory; don't know about Mac but worst case you could write a shell script: #!/bin/sh cd /PATH/YOU/WANT idle3 "$@" and create a launch icon for that... -------------- next part -------------- An HTML attachment was scrubbed... URL: