Re: [ANN] Free Python tutorial with exercises, cscx.org

2021-04-13 Thread Russell via Python-list
Jach Feng wrote: > Is there any reason a student/beginner learn Python now start from Python2? > > --Jach Only if you want a job porting python2 to python3. Python 2.x is officially End Of Life. -- rust 0x68caecc97f6a90122e51c0692c88d9cb6b58a3dc -- https://mail.python.org/mailman/listinfo/p

Re: UI design: combobox or radiobuttons?

2021-04-13 Thread Rich Shepard
On Wed, 14 Apr 2021, Alan Gauld via Python-list wrote: readability? If the combo box puts the units immediately beside the value then it will be more readable than if it is a row of radio buttons above/below or beside the value. But if the radio buttons represent a unit choice that applies to a

Re: UI design: combobox or radiobuttons?

2021-04-13 Thread Alan Gauld via Python-list
On 13/04/2021 22:53, Rich Shepard wrote: > While a set of radiobuttons occupies more room on the parent widget than > does a combobox are there any technical or user issues that would suggest > using one over the other? readability? If the combo box puts the units immediately beside the value the

Re: translating external files type thing

2021-04-13 Thread Terry Reedy
On 4/13/2021 4:53 PM, Avi Gross via Python-list wrote: https://translate.google.com/?sl=is&tl=en&op=translate Or, you could do it the hard way. Kidding aside, there may be a python module you can hand a file name or contents to and have it do much of the job using some API that may tap into the

How does "__doc__ % globals()" work?

2021-04-13 Thread Jaime
Chris and Ethan, Thank you both for your explanations - as soon as I read them, I understood where I was going wrong. I also found the mapping key "%(PROGRAM)s" inside the docstring on line 4 of https://github.com/python/peps/blob/master/pep2html.py Thanks again, Jaime. -- https://mail.python.or

Re: UI design: combobox or radiobuttons?

2021-04-13 Thread Mirko via Python-list
Am 13.04.2021 um 23:53 schrieb Rich Shepard: > My applications use environmental data, each of which has to specify > the > units (e.g., cm, m, km, ft, yd, mi). With the widget sets I've used > (wxPython and TKinter) I've always used a combobox with the acceptable > choices in it. I'm now planning

UI design: combobox or radiobuttons?

2021-04-13 Thread Rich Shepard
My applications use environmental data, each of which has to specify the units (e.g., cm, m, km, ft, yd, mi). With the widget sets I've used (wxPython and TKinter) I've always used a combobox with the acceptable choices in it. I'm now planning a new application using PyQt5 and it occured to me tha

RE: translating external files type thing

2021-04-13 Thread Avi Gross via Python-list
https://translate.google.com/?sl=is&tl=en&op=translate Or, you could do it the hard way. Kidding aside, there may be a python module you can hand a file name or contents to and have it do much of the job using some API that may tap into the above Google resource. Dan specifically suggested impor

Re: translating external files type thing

2021-04-13 Thread Dan Stromberg
Hi. Does this give you any ideas? #!/usr/bin/env python3 """Quick translation program - English to Icelandic.""" # import pprint import googletrans # pprint.pprint(googletrans.LANGUAGES) translator = googletrans.Translator() with open('input-file', 'r') as file_: english_text = file_.re

translating external files type thing

2021-04-13 Thread Quentin Bock
okay, so I'm making a translating program, and I have files set to be translated (they're in Icelandic) and I want all of them to be read in English but I'm not sure how to open the files and translate them at the same time. I'm also not even sure how to translate an external file to English from a

Re: Comparing text strings

2021-04-13 Thread Rich Shepard
On Tue, 13 Apr 2021, jak wrote: If I understand your problem correctly, the problem would be dealing with numbers as such in file names. This is just a track but it might help you. This example splits filenames into strings and numbers into tuples, appends the tuple into a list, and then sorts t

Hypertag - new language for HTML templating with Django support (announcement)

2021-04-13 Thread Marcin Wojnarski
Hello everyone, Hypertag (http://hypertag.io/) is a new language for document generation and HTML templating that has been released recently. Inspired by indentation-based template languages (Slim, Haml, Shpaml), it provides clean, readable syntax and multiple original features: - native

Re: Comparing text strings

2021-04-13 Thread jak
Il 13/04/2021 01:11, Rich Shepard ha scritto: 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

Re: ipython display figure

2021-04-13 Thread Stestagg
I'm guessing here a little bit, but it looks like the author expects you to run this code in a jupyter notebook, rather than in an ipython interactive console. The jupyter and ipython projects are related (the same?) which can cause some confusion, but if you run the code you shared in a jupyter l

Re: Immutable view classes - inherit from dict or from Mapping?

2021-04-13 Thread Serhiy Storchaka
13.04.21 15:47, Peter Otten пише: > As to the | operator, maybe it could be added to Mapping? The | operator returns a new instance, but constructor is not a part of the Mapping interface. You cannot make a general implementation, and making __or__ an abstract method will break all existing Mappin

Re: Immutable view classes - inherit from dict or from Mapping?

2021-04-13 Thread Serhiy Storchaka
12.04.21 19:01, 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 implem

Re: Comparing text strings

2021-04-13 Thread Grant Edwards
On 2021-04-12, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > I don't know whether or how Slackware handles "compound" package names > (e.g., python-flask), but at some point, you're going to have to pull > apart (aka---gasp--parse), the package names to come up

Re: Comparing text strings

2021-04-13 Thread Mats Wichmann
On 4/12/21 5:11 PM, 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, whic

googletrans problems in python

2021-04-13 Thread Quentin Bock
so I've been experiencing problems with googletrans in python and just found a solution that actually works for me. If you have not tried this option and are having problems with googletrans try this method: *This may work for some and not other I'm too sure install googletrans 3.1.0 using pip i

ipython display figure

2021-04-13 Thread Peng Yu
Hi, https://www.fuzzingbook.org/html/Grammars.html I am trying to follow an example on the above page. But it does not show a figure. Could anybody let me know how to display the figure? $ ipython3 Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) Type 'copyright', 'credits' or 'license'

Re: Immutable view classes - inherit from dict or from Mapping?

2021-04-13 Thread Peter Otten
On 12/04/2021 18:01, Andreas R Maier wrote: 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

Re: Comparing text strings

2021-04-13 Thread Rich Shepard
On Tue, 13 Apr 2021, Cameron Simpson wrote: The problem is not that simple. Sometimes the package maintainer upgrades the package for the same version number so there could be abc-1.0_1_SBo.tgz and abc-1.0_2_SBo.tgz. The more involved route will be taken. If that _1, _2 thing is like RedHat's