Re: Problem exiting from a script using tkinter

2020-11-21 Thread Chris Angelico
On Sun, Nov 22, 2020 at 9:36 AM Paulo da Silva wrote: > > Às 22:18 de 21/11/20, Chris Angelico escreveu: > > On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva > > wrote: > >> > >> Hi! > >> > >> Why this does not work?! > >> > >> from tkinter import * > >> > >> def terminate(root): > >> root.quit

Re: Problem exiting from a script using tkinter

2020-11-21 Thread Paulo da Silva
Às 22:18 de 21/11/20, Chris Angelico escreveu: > On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva > wrote: >> >> Hi! >> >> Why this does not work?! >> >> from tkinter import * >> >> def terminate(root): >> root.quit >> > > Is root.quit a function? Simply referencing a function's name does not >

Re: Problem exiting from a script using tkinter

2020-11-21 Thread Chris Angelico
On Sun, Nov 22, 2020 at 9:16 AM Paulo da Silva wrote: > > Hi! > > Why this does not work?! > > from tkinter import * > > def terminate(root): > root.quit > Is root.quit a function? Simply referencing a function's name does not call it (because functions are first-class objects - you can put a

Problem exiting from a script using tkinter

2020-11-21 Thread Paulo da Silva
Hi! Why this does not work?! from tkinter import * def terminate(root): root.quit root=Tk() #b=Button(root,text="QUIT",command=root.quit) b=Button(root,text="QUIT",command=lambda: terminate(root)) b.pack() mainloop() Thanks -- https://mail.python.org/mailman/listinfo/python-list

Automatically advancing a bi-directional generator to the point of accepting a non-None value?

2020-11-21 Thread Go Luhng
Suppose we write a very simple bi-directional generator in Python: def share_of_total(): s = 0 new_num = 0 while True: new_num = yield new_num / (s or 1) s += new_num share_calculator = share_of_total() next(share_calculator) # Without

Cannot update parso

2020-11-21 Thread Cecil Westerhof via Python-list
I cannot update parso because of the rule from jedi: <0.8.0,>=0.7.0 This kind of things happens more often, but normally in less of a week the module that prevents another to be installed is updated and the restriction is lifted. But I think it is about half a year that this restriction is ac

Re: Python Client Rest API Invocation - POST with empty body - Invalid character found in method name [{}POST]. HTTP method names must be tokens

2020-11-21 Thread Peter J. Holzer
On 2020-11-19 15:12:39 +, Shelke, Bhushan wrote: > I have a Tomcat+Java based server exposing REST APIs. I am writing a > client in python to consume those APIs. Everything is fine until I > send empty body in POST request. It is a valid use case for us. If I > send empty body I get 400 bad req