Re: tkinter MP working like a charm

2017-12-31 Thread Abdur-Rahmaan Janhangeer
it seems that the original poster's mail went missing leugenpresse means lying press btw weird i doubt the author wanted to prank us by announcing i did this and that. Abdur-Rahmaan Janhangeer, Mauritius abdurrahmaanjanhangeer.wordpress.com On 31 Dec 2017 5:00 am, "Wu Xi" wrote: > from tkint

Scientific Python moving to Python 3 only.

2017-12-31 Thread Terry Reedy
https://github.com/numpy/numpy/blob/master/doc/neps/dropping-python2.7-proposal.rst Numpy people currently plan to stop adding features to their 2.7 branch after Dec 31, 2018 and stop adding bug fixes to the last version supporting 2.7 a year later, Dec 31, 2019. It will remain available for

Re: tkinter MP working like a charm

2017-12-31 Thread Terry Reedy
On 12/31/2017 8:52 PM, Terry Reedy wrote: To do everything in the main thread, one can replace 'root.mainloop' with loop.run_forever (in the main thread) and repeated root.update calls. Wu Xi's example, rewritten more or less as suggested: from tkinter import * from tkinter import messagebox

Re: Mr. Conway in 50 lines of code (Posting On Python-List Prohibited)

2017-12-31 Thread Lawrence D’Oliveiro
On Sunday, December 31, 2017 at 11:13:41 PM UTC+13, Wu Xi wrote: > yield x + 1 , y > yield x - 1 , y > yield x , y + 1 > yield x , y - 1 #this is proof that life can emerge > inside of computers and cellular automatons, > > yield x + 1 , y + 1 #

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 17:01, breamore...@gmail.com wrote: Further I've never once in 17 years of using Python been tearing my hair out over the lack of goto Neither have I over all the advanced features of Python I never use, and for double that number of years. Yet for some they will be as indisp

Re: Copy-on-write friendly Python garbage collection

2017-12-31 Thread Wu Xi
breamore...@gmail.com: > An interesting write up on something that is incorporated into Python 3.7 > https://engineering.instagram.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf Appearantly, Erlang is the way to go, when it comes to web frameworks. -- https://mail.python.org/m

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread mm0fmf
On 31/12/2017 17:01, breamore...@gmail.com wrote: I would use functions every time as a modern compiler can inline them This Further I've never once in 17 years of using Python been tearing my hair out over the lack of goto And this. (In my case only 6 years.) -- https://mail.python.org/

OK, now one main block only , but loop.run_forever() ? idk...

2017-12-31 Thread Wu Xi
from tkinter import *#I cant see anything wrong with the async_loop business here. It works like a charm. from tkinter import messagebox #is there a serious concern doing things his way ? import asyncio , threading , random

Re: tkinter MP working like a charm

2017-12-31 Thread Terry Reedy
On 12/30/2017 7:57 PM, Wu Xi wrote: from tkinter import *#I cant see anything wrong with this , it works like a charm This imports about 200 names. A reader may not know which names are builtins and which are imports. There may also be accidental name

Re: How to exec a string which has an embedded '\n'? (Posting On Python-List Prohibited)

2017-12-31 Thread jfong
Lawrence D’Oliveiro於 2018年1月1日星期一 UTC+8上午7時56分02秒寫道: > On Sunday, December 31, 2017 at 11:04:19 PM UTC+13, jf...@ms4.hinet.net wrote: > > > > This answer makes me think about '\' more thoughtful:-) > > Python generating HTML containing JavaScript which generates HTML: > > out.write \ >

you shortened it, but you broke it too... ;-)

2017-12-31 Thread Wu Xi
import time , itertools __doc__=" Mr Conway_s Game Of Life simulation in python 2 and 3 " width = 100 ; height = 50# size of life habitat , e.g. a simulated meteorite, bolide , etc. vmap = [['D' for w in range(width)] for h in range(height)] # D = Dead at first def neighbo

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Ben Bacarisse
bartc writes: > On 31/12/2017 22:09, Ben Bacarisse wrote: > >> No, you missed the point and did not address the question. You said (now >> cut) >> >> | If I thought introducing functions, whether local or not, as a way of >> | avoiding goto was worth doing, I would do so. >> >> but I'm not sure

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread MRAB
On 2017-12-31 23:21, bartc wrote: On 31/12/2017 22:09, Ben Bacarisse wrote: No, you missed the point and did not address the question. You said (now cut) | If I thought introducing functions, whether local or not, as a way of | avoiding goto was worth doing, I would do so. but I'm not sure y

Re: Python: asyncio and Tkinter (Posting On Python-List Prohibited)

2017-12-31 Thread Wu Xi
Lawrence D’Oliveiro: > On Sunday, December 31, 2017 at 12:47:21 PM UTC+13, Wu Xi wrote: >> this is kinda interesting. seems there is no easy way though > > If I could do it for GTK/GLib , I don’t see > why Tk should be hard. ;) well, hard or no, but glibcoro is

Re: tkinter MP working like a charm (Posting On Python-List Prohibited)

2017-12-31 Thread Wu Xi
Lawrence D’Oliveiro: > On Sunday, December 31, 2017 at 10:23:32 PM UTC+13, Wu Xi wrote: >> >> I was originally referring to the handling of multi-tasking... which >> some found a bit outlandish. >> >> I cannot see why, though. > > I just can’t help thinking that you are using two threads to handle

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 22:09, Ben Bacarisse wrote: No, you missed the point and did not address the question. You said (now cut) | If I thought introducing functions, whether local or not, as a way of | avoiding goto was worth doing, I would do so. but I'm not sure you know if it's worth it or not. S

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Ben Bacarisse
bartc writes: > On 31/12/2017 15:02, Ben Bacarisse wrote: >> bartc writes: > >> I think there's a problem with that. Standard C does not have them, you >> said your language does not implement them properly > > (The real problem is I don't remember local functions being used > anywhere else. It

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Chris Angelico
On Mon, Jan 1, 2018 at 6:29 AM, bartc wrote: > You'll need to give an example I think. Suppose I start with this: > > def fn(a): > if a==1: > print ("One") > print ("Two") > print ("Three") > elif a==2: > print ("Four") > else: > print ("Other")

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 19:29, bartc wrote: [Ignore the original, incomplete version of my post, which appears after the sig. I decided to actually try it out for real instead of just guessing! Good thing too.] -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 17:06, Chris Angelico wrote: On Mon, Jan 1, 2018 at 3:55 AM, bartc wrote: The suggestion was to use them to avoid gotos. If duplicating is a good idea (and it's a hard line to draw) then we are not talking about the same cases. Given the choice of "dragging in named functions" a

Re: Copy-on-write friendly Python garbage collection

2017-12-31 Thread Wu Xi
they said they run the largest deployment of Django world-wide. be it as it may... many still consider the web guys to be the "funny people". Why did they not switch over to Erlang ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Copy-on-write friendly Python garbage collection

2017-12-31 Thread Wu Xi
breamore...@gmail.com: > An interesting write up on something that is incorporated into Python 3.7 > https://engineering.instagram.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf kewl py 3.7 does not fully make install here, but it built and works, as far as I can tell -- htt

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread breamoreboy
On Sunday, December 31, 2017 at 3:02:41 PM UTC, Ben Bacarisse wrote: > bartc writes: > > > On 31/12/2017 12:41, Chris Angelico wrote: > >> On Sun, Dec 31, 2017 at 11:33 PM, bartc wrote: > >>> On 30/12/2017 23:54, Chris Angelico wrote: > > > I've written code that uses dirty tricks like that

Copy-on-write friendly Python garbage collection

2017-12-31 Thread breamoreboy
An interesting write up on something that is incorporated into Python 3.7 https://engineering.instagram.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf -- Kindest regards. Mark Lawrence. -- https://mail.python.org/mailman/listinfo/python-list

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Chris Angelico
On Mon, Jan 1, 2018 at 3:55 AM, bartc wrote: >> The suggestion was to use them to avoid gotos. If duplicating is a good >> idea (and it's a hard line to draw) then we are not talking about the >> same cases. Given the choice of "dragging in named functions" and >> dragging in named blocks and go

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 15:02, Ben Bacarisse wrote: bartc writes: I think there's a problem with that. Standard C does not have them, you said your language does not implement them properly (The real problem is I don't remember local functions being used anywhere else. It's an idiom I'm not used to

Re: emacsclient does not select frame?

2017-12-31 Thread Rustom Mody
On Sunday, December 31, 2017 at 9:00:53 PM UTC+5:30, Rustom Mody wrote: > With a lot of jumping through hoops Ive managed to get firefox to > call emacs(client) and save links+description(title)+selection(in firefox; > optional) into an org mode capture buffer. > > However the call to emacsclient

emacsclient does not select frame?

2017-12-31 Thread Rustom Mody
With a lot of jumping through hoops Ive managed to get firefox to call emacs(client) and save links+description(title)+selection(in firefox; optional) into an org mode capture buffer. However the call to emacsclient does not raise the frame... At least not consistently? Currently my hack is to

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Ben Bacarisse
bartc writes: > On 31/12/2017 12:41, Chris Angelico wrote: >> On Sun, Dec 31, 2017 at 11:33 PM, bartc wrote: >>> On 30/12/2017 23:54, Chris Angelico wrote: > I've written code that uses dirty tricks like that to avoid duplication. It's at least as much of a problem as actual duplicatio

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 31/12/2017 12:41, Chris Angelico wrote: On Sun, Dec 31, 2017 at 11:33 PM, bartc wrote: On 30/12/2017 23:54, Chris Angelico wrote: I've written code that uses dirty tricks like that to avoid duplication. It's at least as much of a problem as actual duplication is. Generally, the 'goto' sol

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread Chris Angelico
On Sun, Dec 31, 2017 at 11:33 PM, bartc wrote: > On 30/12/2017 23:54, Chris Angelico wrote: >> >> 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

Re: Goto (Posting On Python-List Prohibited)

2017-12-31 Thread bartc
On 30/12/2017 23:54, Chris Angelico wrote: 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

Mr. Conway in 50 lines of code

2017-12-31 Thread Wu Xi
import time , itertools __doc__=" Mr Conway_s Game Of Life simulation in python 2 and 3 " width = 55 ; height = 55# size of life habitat , e.g. a simulated meteorite, bolide , etc. vmap = [['D' for w in range(width)] for h in range(height)] # D = Dead at first def neighbou

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

2017-12-31 Thread jfong
Random832於 2017年12月31日星期日 UTC+8下午1時25分50秒寫道: > 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? > >

Re: a nice editor in 100 lines

2017-12-31 Thread Wu Xi
https://github.com/morten1982/crossviper > > nice find! > > > works smoothly here, except running the opened file kinda not path finding... > gotta be easy to fix. > take that back in xterm mode , path is no problem. nice IDE ! -- https://mail.python.org/mailman/listinfo/python-list

Re: a nice editor in 100 lines

2017-12-31 Thread Wu Xi
wxjmfa...@gmail.com: > Le dimanche 31 décembre 2017 10:33:03 UTC+1, wxjm...@gmail.com a écrit : >> Le samedi 30 décembre 2017 23:02:41 UTC+1, Wu Xi a écrit : > Addendum > > This one is also not working. > > https://www.reddit.com/r/Python/comments/7murk2/a_python_ide_made_with_tkinter_it_should_

Re: tkinter MP working like a charm

2017-12-31 Thread Wu Xi
OK, I never figured out that "import *" business... I was originally referring to the handling of multi-tasking via the root.mainloop() if __name__ == '__main__': async_loop = asyncio.get_event_loop()# all in this loop submain(async_loop) business , which some found a

Re: tkinter MP working like a charm

2017-12-31 Thread Chris Angelico
On Sun, Dec 31, 2017 at 8:03 PM, Abdur-Rahmaan Janhangeer wrote: > @Chris > > hum nice point > > it seems to be related to namespace convenience > > like > > 1 from x import * > > is likelier to cause conflicts than > > 2 import x This is correct. Also, when you read the code, you can instantly t

Re: tkinter MP working like a charm

2017-12-31 Thread Abdur-Rahmaan Janhangeer
@Chris hum nice point it seems to be related to namespace convenience like 1 from x import * is likelier to cause conflicts than 2 import x Abdur-Rahmaan Janhangeer, Mauritius abdurrahmaanjanhangeer.wordpress.com On 31 Dec 2017 05:00, "Wu Xi" wrote: > from tkinter import *