Style qeustion: Multiple return values

2021-04-12 Thread Steve Keller
Just a short style question: When returning multiple return values, do you use parenthesis? E.g. would you write def foo(): return 1, 2 a, b = foo() or do you prefer def foo(): return (1, 2) (a, b) = foo() Steve -- https://mail.python.org/mailman/listinfo/py

Re: Style qeustion: Multiple return values

2021-04-12 Thread dn via Python-list
On 12/04/2021 20.29, Steve Keller wrote: > Just a short style question: When returning multiple return values, do > you use parenthesis? > > E.g. would you write > > def foo(): > return 1, 2 > > a, b = foo() > > or do you prefer > > def foo(): > return (1, 2) > >

Re: Style qeustion: Multiple return values

2021-04-12 Thread Chris Angelico
On Mon, Apr 12, 2021 at 8:20 PM dn via Python-list wrote: > > On 12/04/2021 20.29, Steve Keller wrote: > > Just a short style question: When returning multiple return values, do > > you use parenthesis? > > Thus, the answer to your question is a matter of style, and thus the > understanding of tho

Re: Style qeustion: Multiple return values

2021-04-12 Thread Terry Reedy
On 4/12/2021 4:29 AM, Steve Keller wrote: Just a short style question: When returning multiple return values, do you use parenthesis? E.g. would you write def foo(): return 1, 2 a, b = foo() or do you prefer def foo(): return (1, 2) (a, b) = foo() No.

Re: Ann: New Python curses book

2021-04-12 Thread Alan Gauld via Python-list
On 12/04/2021 00:53, Daniel Nelson wrote: >> (It should be available in most other Amazon stores too) > > This looks handy, I'd love to buy a copy but I don't do business with > Amazon if I can avoid it. Any chance this will be available from other > locations? I tried to publish it on several

googletrans in python

2021-04-12 Thread Quentin Bock
Can someone explain the basics of googletrans in python? I want to make a program that translates stories into English, but I'm not sure how to get a translation printed. Also, is this needed to be done in an HTML file inside python? If so can someone provide basic code for a translation and how th

Re: Style qeustion: Multiple return values

2021-04-12 Thread Dan Stromberg
On Mon, Apr 12, 2021 at 1:30 AM Steve Keller wrote: > Just a short style question: When returning multiple return values, do > you use parenthesis? > > E.g. would you write > > def foo(): > return 1, 2 > > a, b = foo() > > or do you prefer > > def foo(): > return (1, 2

Re: Style qeustion: Multiple return values

2021-04-12 Thread 2QdxY4RzWzUUiLuE
On 2021-04-12 at 09:54:13 -0700, Dan Stromberg wrote: > On Mon, Apr 12, 2021 at 1:30 AM Steve Keller wrote: > > > Just a short style question: When returning multiple return values, do > > you use parenthesis? > > > > E.g. would you write > > > > def foo(): > > return 1, 2 > > > >

Re: googletrans in python

2021-04-12 Thread Dan Stromberg
Does this help? https://zetcode.com/python/googletrans/ It was the first google search hit on 'googletrans python example'. On Mon, Apr 12, 2021 at 9:49 AM Quentin Bock wrote: > Can someone explain the basics of googletrans in python? > I want to make a program that translates stories into En

ANN: Wing Python IDE 7.2.9 has been released

2021-04-12 Thread Wingware
Wing 7.2.9 adds remote development for 64-bit Raspberry Pi, improves auto-closing of quotes, optimizes change tracking when large numbers of project files change at once, improves debugger data display for some value types, and makes a number of other usability improvements. Details:  https://

Immutable view classes - inherit from dict or from Mapping?

2021-04-12 Thread Andreas R Maier
Hi, I have written some classes that represent immutable views on collections (see "immutable-views" package on Pypi). Currently, these view classes inherit from the abstract collection classes such as Mapping, Sequence, Set. However, they implement the read-only methods of dict, list and set,

Re: Style qeustion: Multiple return values

2021-04-12 Thread Rob Cliffe via Python-list
On 12/04/2021 09:29, Steve Keller wrote: Just a short style question: When returning multiple return values, do you use parenthesis? E.g. would you write def foo(): return 1, 2 a, b = foo() or do you prefer def foo(): return (1, 2) (a, b) = foo() Stev

Re: googletrans in python

2021-04-12 Thread Karsten Hilbert
Am Mon, Apr 12, 2021 at 12:48:23PM -0400 schrieb Quentin Bock: > Can someone explain the basics of googletrans in python? > I want to make a program that translates stories into English, but I'm not > sure how to get a translation printed. Also, is this needed to be done in > an HTML file inside p

How does "__doc__ % globals()" work?

2021-04-12 Thread Jaime
Hi all. Line 102 of https://github.com/python/peps/blob/master/pep2html.py says: print(__doc__ % globals(), file=out) and I've just spent all day trying to understand "__doc__ % globals()". Sure, I realise that globals() is a standard-library built-in functions that returns a dictionary represent

Re: googletrans in python

2021-04-12 Thread Terry Reedy
On 4/12/2021 12:48 PM, Quentin Bock wrote: Can someone explain the basics of googletrans in python? You most likely want to install https://pypi.org/project/googletrans/ -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: How does "__doc__ % globals()" work?

2021-04-12 Thread Chris Angelico
On Tue, Apr 13, 2021 at 8:57 AM Jaime wrote: > > Hi all. Line 102 of https://github.com/python/peps/blob/master/pep2html.py > says: > > print(__doc__ % globals(), file=out) > > and I've just spent all day trying to understand "__doc__ % > globals()". The docstring for any function, class, or mod

Comparing text strings

2021-04-12 Thread Rich Shepard
I'm running Slackware64-14.2 and keep a list of installed packages. When a package is upgraded I want to remove the earlier version, and I've not before written a script like this. Could there be a module or tool that already exists to do this? If not, which string function would be best suited to

Error 2503

2021-04-12 Thread Crt Gorican
Dear Python team, I am writing to you because I am desperate. I've tried everything I could find on the internet before writing to you. I've started developing a python script in my IDE and the python was simply not working for me. I've tried it in cmd and there was this message "The system cannot

Re: How does "__doc__ % globals()" work?

2021-04-12 Thread Ethan Furman
On 4/12/21 3:06 PM, Jaime wrote: > Hi all. Line 102 of https://github.com/python/peps/blob/master/pep2html.py says: > > print(__doc__ % globals(), file=out) > > I realise that globals() is a standard-library > built-in function that returns a dictionary representing the current > global symbol ta

Re: Comparing text strings

2021-04-12 Thread 2QdxY4RzWzUUiLuE
On 2021-04-12 at 16:11:21 -0700, Rich Shepard wrote: > I'm running Slackware64-14.2 and keep a list of installed packages. When a > package is upgraded I want to remove the earlier version, and I've not > before written a script like this. Could there be a module or tool that > already exists to

Re: Error 2503

2021-04-12 Thread Cameron Simpson
On 13Apr2021 01:15, Crt Gorican wrote: >Dear Python team, > >I am writing to you because I am desperate. I've tried everything I >could find on the internet before writing to you. >I've started developing a python script in my IDE and the python was >simply not working for me. >I've tried it in cm

Re: Comparing text strings

2021-04-12 Thread Cameron Simpson
On 12Apr2021 16:11, Rich Shepard wrote: >I'm running Slackware64-14.2 and keep a list of installed packages. When a >package is upgraded I want to remove the earlier version, and I've not >before written a script like this. Could there be a module or tool that >already exists to do this? If not, w

Re: Comparing text strings

2021-04-12 Thread Chris Angelico
On Tue, Apr 13, 2021 at 9:54 AM Cameron Simpson wrote: > Note that this depends on sorting by version. A lexical sort (eg > "ls|sort") will look good intil a package version crosses a boundary > like this: > > 1.9.1 > 1.10.0 > > A lexical sort will put those the other way around because "9

Re: Comparing text strings

2021-04-12 Thread Rich Shepard
On Tue, 13 Apr 2021, Cameron Simpson wrote: I do not know if there are preexisting modules/tools for this, but I recommend looking at slackware's package management tool - they usually have some kind of 'clean" operation to purge "old" package install files. Sometimes that purges all the install

Re: Comparing text strings

2021-04-12 Thread Cameron Simpson
On 12Apr2021 19:11, Rich Shepard wrote: >On Tue, 13 Apr 2021, Cameron Simpson wrote: >>Alternatively, and now that I think about it, more simply: _if_ the >>package files can be sorted by version, then all you need to do is read a >>sorted listing and note that latest fil for a particular package.

Re: Style qeustion: Multiple return values

2021-04-12 Thread dn via Python-list
On 12/04/2021 22.32, Chris Angelico wrote: > On Mon, Apr 12, 2021 at 8:20 PM dn via Python-list > wrote: >> >> On 12/04/2021 20.29, Steve Keller wrote: >>> Just a short style question: When returning multiple return values, do >>> you use parenthesis? >> >> Thus, the answer to your question is a m

Re: Style qeustion: Multiple return values

2021-04-12 Thread Chris Angelico
On Tue, Apr 13, 2021 at 4:26 PM dn via Python-list wrote: > > On 12/04/2021 22.32, Chris Angelico wrote: > > On Mon, Apr 12, 2021 at 8:20 PM dn via Python-list > > wrote: > >> > >> On 12/04/2021 20.29, Steve Keller wrote: > >>> Just a short style question: When returning multiple return values, d