Re: tkinter MP working like a charm

2017-12-30 Thread Chris Angelico
On Sun, Dec 31, 2017 at 4:02 PM, Abdur-Rahmaan Janhangeer wrote: > for beginners import * is probably fine. Even if you are using most modules > then too. else if module small maybe ok too > > just when you import just what you need, you save on resources . > Actually no; the entire module still

Re: How to exec a string which has an embedded '\n'?

2017-12-30 Thread Random832
On Sat, Dec 30, 2017, at 23:57, jf...@ms4.hinet.net wrote: > I have a multiline string, something like '''...\nf.write('\n')\n...''' > when pass to exec(), I got > SyntaxError: EOL while scanning string literal > > How to get rid of it? Use \\n for this case, since you want the \n to be interpret

Re: tkinter MP working like a charm

2017-12-30 Thread Abdur-Rahmaan Janhangeer
for beginners import * is probably fine. Even if you are using most modules then too. else if module small maybe ok too just when you import just what you need, you save on resources . Abdur-Rahmaan Janhangeer, Mauritius abdurrahmaanjanhangeer.wordpress.com On 31 Dec 2017 05:00, "Wu Xi" wrote:

Re: a nice editor in 100 lines

2017-12-30 Thread Abdur-Rahmaan Janhangeer
great ! maybe the next step is a syntax coloriser ^^_ Abdur-Rahmaan Janhangeer, Mauritius abdurrahmaanjanhangeer.wordpress.com On 31 Dec 2017 02:05, "Wu Xi" wrote: > class writerKl(object): > def __init__(self): > import tkinter > fromtkinter import messagebox >

How to exec a string which has an embedded '\n'?

2017-12-30 Thread jfong
I have a multiline string, something like '''...\nf.write('\n')\n...''' when pass to exec(), I got SyntaxError: EOL while scanning string literal How to get rid of it? Best Regards, Jach Fong -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Ben Bacarisse
bartc writes: > On 30/12/2017 20:36, Ben Bacarisse wrote: >> bartc writes: >> >>> On 30/12/2017 16:53, mm0fmf wrote: On 30/12/2017 14:41, bartc wrote: > it looks a bit naff Understatement of 2017. >>> >>> I'm honest about my own ideas, but my remarks were about the use of >>>

tkinter MP working like a charm

2017-12-30 Thread Wu Xi
from tkinter import *#I cant see anything wrong with this , it works like a charm from tkinter import messagebox #is there a serious concern doing things his way ? import asyncio , threading , random #

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread MRAB
On 2017-12-30 23:22, Gregory Ewing wrote: Stefan Ram wrote: BASIC has DEF FN... which /can/ define actual subroutines, limited to expressions. Now, what does this limitation remind me of? The equivalent limitation in Python is nowhere near as bad, since if you outgrow what lambda can

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Chris Angelico
On Sun, Dec 31, 2017 at 10:45 AM, bartc wrote: > On 30/12/2017 23:26, Gregory Ewing wrote: >> >> bartc wrote: >>> >>> B and C occur twice, so a goto is a quick way to reuse B and C without >>> needing to duplicate code, >> >> >> This only works if the repeated part happens to be at the >> tail of

Re: Python: asyncio and Tkinter

2017-12-30 Thread Wu Xi
this is kinda interesting. seems there is no easy way though -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread bartc
On 30/12/2017 23:26, Gregory Ewing wrote: bartc wrote: B and C occur twice, so a goto is a quick way to reuse B and C without needing to duplicate code, This only works if the repeated part happens to be at the tail of each case. IME that seems to be the most common situation. Any other si

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
bartc wrote: B and C occur twice, so a goto is a quick way to reuse B and C without needing to duplicate code, This only works if the repeated part happens to be at the tail of each case. Any other situation and you're back to local functions. -- Greg -- https://mail.python.org/mailman/listinf

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
bartc wrote: C doesn't in general have local functions. My own languages don't implement them properly. So I tend not to use them. Looks like there's something circular going on here. You don't have much experience of using local functions, so you don't see a lot of value in them, so you haven'

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
Stefan Ram wrote: BASIC has DEF FN... which /can/ define actual subroutines, limited to expressions. Now, what does this limitation remind me of? The equivalent limitation in Python is nowhere near as bad, since if you outgrow what lambda can do you can always use a def instead. BASIC

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Chris Angelico
On Sun, Dec 31, 2017 at 9:43 AM, bartc wrote: > On 30/12/2017 20:36, Ben Bacarisse wrote: >> >> bartc writes: >> >>> On 30/12/2017 16:53, mm0fmf wrote: On 30/12/2017 14:41, bartc wrote: > > it looks a bit naff Understatement of 2017. >>> >>> >>> I'm honest about m

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread bartc
On 30/12/2017 20:36, Ben Bacarisse wrote: bartc writes: On 30/12/2017 16:53, mm0fmf wrote: On 30/12/2017 14:41, bartc wrote: it looks a bit naff Understatement of 2017. I'm honest about my own ideas, but my remarks were about the use of special symbols such as "::" and "@". Before compl

Re: Tkinter,show pictures from the list of files in catalog-problem

2017-12-30 Thread Wu Xi
nothing works in ure soft everything breaks -- https://mail.python.org/mailman/listinfo/python-list

Re: Anaconda Navigator : Add App

2017-12-30 Thread Wu Xi
that is a very slow manager. too slow. -- https://mail.python.org/mailman/listinfo/python-list

a nice editor in 100 lines

2017-12-30 Thread Wu Xi
class writerKl(object): def __init__(self): import tkinter fromtkinter import messagebox fromtkinter import filedialog fromtkinter import Tk fromtkinter import Menu fromtkinter impor

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread William Ray Wing
> On Dec 30, 2017, at 7:46 AM, Peter J. Holzer wrote: > > On 2017-12-29 19:09:35 -0500, Dennis Lee Bieber wrote: >> On Fri, 29 Dec 2017 23:12:22 +, bartc declaimed the >> following: >>> Looking at 14 million lines of Linux kernel sources, which are in C, >>> over 100,000 of them use 'goto'

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Chris Angelico
On Sun, Dec 31, 2017 at 7:36 AM, Ben Bacarisse wrote: > bartc writes: > >> On 30/12/2017 16:53, mm0fmf wrote: >>> On 30/12/2017 14:41, bartc wrote: it looks a bit naff >>> >>> Understatement of 2017. >> >> I'm honest about my own ideas, but my remarks were about the use of >> special symbols

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Ben Bacarisse
bartc writes: > On 30/12/2017 16:53, mm0fmf wrote: >> On 30/12/2017 14:41, bartc wrote: >>> it looks a bit naff >> >> Understatement of 2017. > > I'm honest about my own ideas, but my remarks were about the use of > special symbols such as "::" and "@". > > Before completely dismissing it however

Re: CFG Python

2017-12-30 Thread Ben Finney
Peter Otten <__pete...@web.de> writes: > > Let's say I vreated my own CFG in python, How can I […] > > Remember, context free grammars may be fine, but context free > questions aren't ;) +1 QotW -- \“The problem with television is that the people must sit and | `\keep their eyes

Re: CFG Python

2017-12-30 Thread Peter Otten
Ranya wrote: > Let's say I vreated my own CFG in python, How can I check now if a > sentence match this grammar (return true) or it doesn't match it (return > false and the wrong element in the grammar), How can I do this ? Remember, context free grammars may be fine, but context free questions

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Ian Kelly
On Sat, Dec 30, 2017 at 8:41 AM, bartc wrote: > (I had introduced a special language feature just for this kind of thing, > but it was unsatisfactory. Goto was simpler and understood by everyone. And > portable to any other language - that hasn't done away with goto. But it > worked like this (not

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread MRAB
On 2017-12-30 18:21, bartc wrote: On 30/12/2017 16:53, mm0fmf wrote: On 30/12/2017 14:41, bartc wrote: it looks a bit naff Understatement of 2017. I'm honest about my own ideas, but my remarks were about the use of special symbols such as "::" and "@". Before completely dismissing it howev

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread bartc
On 30/12/2017 16:53, mm0fmf wrote: On 30/12/2017 14:41, bartc wrote: it looks a bit naff Understatement of 2017. I'm honest about my own ideas, but my remarks were about the use of special symbols such as "::" and "@". Before completely dismissing it however, you should look at how anothe

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread mm0fmf
On 30/12/2017 14:41, bartc wrote: it looks a bit naff Understatement of 2017. -- https://mail.python.org/mailman/listinfo/python-list

CFG Python

2017-12-30 Thread Ranya
Let's say I vreated my own CFG in python, How can I check now if a sentence match this grammar (return true) or it doesn't match it (return false and the wrong element in the grammar), How can I do this ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread bartc
On 30/12/2017 03:05, Lawrence D’Oliveiro wrote: On Saturday, December 30, 2017 at 12:12:23 PM UTC+13, bartc wrote: Looking at 14 million lines of Linux kernel sources, which are in C, over 100,000 of them use 'goto'. About one every 120 lines. That kind of thing leads to spaghetti code. Here

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Peter J. Holzer
On 2017-12-29 19:09:35 -0500, Dennis Lee Bieber wrote: > On Fri, 29 Dec 2017 23:12:22 +, bartc declaimed the > following: > >Looking at 14 million lines of Linux kernel sources, which are in C, > >over 100,000 of them use 'goto'. About one every 120 lines. > > > > C is a language that