From taleinat at gmail.com Tue Jul 23 09:37:07 2019 From: taleinat at gmail.com (Tal Einat) Date: Tue, 23 Jul 2019 16:37:07 +0300 Subject: [Idle-dev] Line numbers in IDLE In-Reply-To: References: Message-ID: Update: This PR has been merged, and will be part of the upcoming 3.8.0 and 3.7.5 releases. On Thu, Jun 13, 2019 at 1:13 AM Tal Einat wrote: > I've just done some work on the (long awaited!) addition of line numbers > to IDLE, and have a working PR ready. If some of you could try it out and > give some feedback, that would be very helpful! > > See bpo-17535 for details; the PR is > GH-14030 . > > Note that this is only for Python 3. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From saramsrl at hotmail.com Tue Jul 30 22:24:13 2019 From: saramsrl at hotmail.com (Sara Mistral) Date: Wed, 31 Jul 2019 02:24:13 +0000 Subject: [Idle-dev] Problem with the latest version of Python on macOS Message-ID: Hello, I downloaded Python recently on my computer and I have some troubles making it work. It doesn?t allow me to make and if function and elif without the good indentation. I have the latest version of Python (3.7.4) and my mac is updated (macOS Mojave 10.14.5). As you can see in the picture, the ?if? doesn?t align properly. I tried with else, elif, if, and every time I hit ?send? it sends me to the wrong indentation. My dad needs this for his work and he?s trying to learn Python but sadly he is stuck. Thank you for your help. Best wishes, Sara [Image] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Image.png Type: image/png Size: 2451176 bytes Desc: Image.png URL: From tjreedy at udel.edu Wed Jul 31 14:13:23 2019 From: tjreedy at udel.edu (Terry Reedy) Date: Wed, 31 Jul 2019 14:13:23 -0400 Subject: [Idle-dev] Line numbers in IDLE In-Reply-To: References: Message-ID: On 7/23/2019 9:37 AM, Tal Einat wrote: > Update: This PR has been merged, and will be part of the upcoming 3.8.0 > and 3.7.5 releases. It is in 3.8.0b3, released two days ago, and is working nicely for me on Windows. Thank you Tal. -- Terry Jan Reedy From tjreedy at udel.edu Wed Jul 31 15:16:22 2019 From: tjreedy at udel.edu (Terry Reedy) Date: Wed, 31 Jul 2019 15:16:22 -0400 Subject: [Idle-dev] Problem with the latest version of Python on macOS In-Reply-To: References: Message-ID: <8f6ade1e-d16f-b0d1-5e3a-5c526aba69de@udel.edu> On 7/30/2019 10:24 PM, Sara Mistral wrote: > I downloaded Python recently on my computer and I have some troubles > making it work. It doesn?t allow me to make and if function and elif > without the good indentation. I have the latest version of Python > (3.7.4) and my mac is updated (macOS Mojave 10.14.5). > As you can see in the picture, Most python mail lists do not allow binary attachments. idledev currently does, but attachments do not follow responses. It is also impossible to copy from images to determine what you entered. Please copy and paste instead of attaching screenshots. >>> if a > 0: print('positive') if a < 0: SyntaxError: invalid syntax With 3.7.3 on my Mac and 3.7.4 on my Windows machine, the second 'if' is highlighted as an error with black type on brownish red background. But I don't see this on your screenshot. Did you create a custom theme with this disabled? If you go to Options => Configure IDLE => Hightlight tab and select Builtin theme IDLE classic, is the word 'error' not so highlighted? > the ?if? doesn?t align properly. You have mixed together two issues. First the syntax: '>>> ' in IDLE's Shell means 'Enter *one* python statement. An 'if' statement can be followed by multiple 'elif' line and one 'else' line. The second 'if' starts a second statement, which is an error when your entry is interpreted as one statement. The following single statement works. >>> if a > 0: print('positive') elif a < 0: print('negative') else: print('zero') positive > I tried with else, elif, if, and every time I hit ?send? it sends me to the wrong indentation. Second, the indentation. The 'if', 'elif', and 'else' lines have the same indentation: none. You have to ignore the prompt. It is not counted as indentation. This awkward convention, and the use of tabs, is a side-effect of Shell's feature of working with statements instead of physical lines. I am preparing a new tracker issue to do away with prompts interfering with code and tab indents. It will make code entry in Shell the same as in IDLE's editor, so one could enter if a > 0: print('positive') elif a < 0: print('negative') else: print('zero') positive the same in both places. > My dad needs this for his work and he?s trying to learn Python but sadly > he is stuck. Not really. Believe SyntaxError and try to get the error highlighting working. -- Terry Jan Reedy From tjreedy at udel.edu Wed Jul 31 15:28:59 2019 From: tjreedy at udel.edu (Terry Reedy) Date: Wed, 31 Jul 2019 15:28:59 -0400 Subject: [Idle-dev] Setting Command Line Arguments in IDLE In-Reply-To: <861a65db-cfdd-059b-f70a-9c1e7ccc3405@udel.edu> References: <7065cefe-682d-722a-30eb-506a7f5a3d92@Damon-Family.org> <861a65db-cfdd-059b-f70a-9c1e7ccc3405@udel.edu> Message-ID: On 5/26/2019 12:40 PM, Terry Reedy wrote: > On 5/26/2019 7:22 AM, Richard Damon wrote: >> I am working on a python script that will be provided arguments when run >> from the system command line. Is there any place in IDLE to provide >> equivalent arguments for testing while developing in IDLE? > > This is the subject of https://bugs.python.org/issue5680.? There is a PR > that needs to be reviewed. This is in 3.7.4 and 3.8.0b3. Run => Run Customized, enter in box. Entry will be put in box (editable) on next invocation. -- Terry Jan Reedy From beni.cherniavsky at gmail.com Wed Jul 31 14:50:04 2019 From: beni.cherniavsky at gmail.com (Beni Cherniavsky-Paskin) Date: Wed, 31 Jul 2019 21:50:04 +0300 Subject: [Idle-dev] Problem with the latest version of Python on macOS In-Reply-To: References: Message-ID: It's not bad indentation. If that were the problem, you'd get `IndentationErrror`. (The indention is good despite looking weird because the `>>> ` is not part of the code - imagine your first `if` starting at colunn 0.) The problem is that IDLE Shell window expects a single expression/statement per prompt, and you gave it 2 separate `if` statements. In many such cases python 3 will give clear "multiple statements" error, but not here. You can confirm this by changing second `if` to e.g. `elif` (which makes them one statement) - that works for me. Same syntax would be fine in a .py file editor window - most python scripts contain many statements It's just limitation of the Shell window - you should execute each statement separately by pressing Enter (possibly twice). Tip: if you do want to paste many statements together, put them all inside an `if True:` block to turn them into 1 statement. If the copied code was not indented, select all pasted code, press Ctrl+] (aka Format -> Indent region - this menu is only visible in editor window but the shortcut works in Shell window too). On Wed, 31 Jul 2019, 20:59 Sara Mistral, wrote: > Hello, > I downloaded Python recently on my computer and I have some troubles > making it work. It doesn?t allow me to make and if function and elif > without the good indentation. I have the latest version of Python (3.7.4) > and my mac is updated (macOS Mojave 10.14.5). > As you can see in the picture, the ?if? doesn?t align properly. I tried > with else, elif, if, and every time I hit ?send? it sends me to the wrong > indentation. > My dad needs this for his work and he?s trying to learn Python but sadly > he is stuck. > Thank you for your help. > Best wishes, > Sara > [image: Image] > > _______________________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: Image.png Type: image/png Size: 2451176 bytes Desc: not available URL: