Re: XML Considered Harmful

2021-09-25 Thread 2QdxY4RzWzUUiLuE
On 2021-09-25 at 15:20:19 -0500, "Michael F. Stemper" wrote: > ... For instance, if > I modeled a fuel like this: > > > ton > 21.96 > 18.2 > > > and a generating unit like this: > > > > > > > > > > > > >

Re: Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread 2QdxY4RzWzUUiLuE
On 2021-09-26 at 11:21:08 -0500, Grant Edwards wrote: > [...] Do you need the 2nd factor every time you connect to GMail via a > browser or Android Gmail app? Or just the first time for each > browser/device? A bit of studying seems to be in order no matter > what. :) No. I use mbsync (formerl

Re: Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread 2QdxY4RzWzUUiLuE
On 2021-09-26 at 17:40:18 -0700, Grant Edwards wrote: > On 2021-09-26, Mats Wichmann wrote: > > On 9/26/21 10:38, 2qdxy4rzwzuui...@potatochowder.com wrote: > >> On 2021-09-26 at 11:21:08 -0500, > > > >> No. I use mbsync (formerly isync) to synchronize my gmail account with > >> a local maildir

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread 2QdxY4RzWzUUiLuE
On 2021-09-28 at 03:23:53 +1000, Chris Angelico wrote: > On Tue, Sep 28, 2021 at 3:11 AM Skip Montanaro > wrote: > >> > >> Those are all warnings. Are there any errors that follow them? > > > > > > Maybe I just missed the actual errors, but the compiler exit status was 1, > > so there must hav

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread 2QdxY4RzWzUUiLuE
On 2021-09-28 at 04:16:58 +1000, Chris Angelico wrote: > On Tue, Sep 28, 2021 at 4:04 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2021-09-28 at 03:23:53 +1000, > > Chris Angelico wrote: > > > > > On Tue, Sep 28, 2021 at 3:11 AM Skip Montanaro > > > wrote: > > > >> > > > >> Those

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread 2QdxY4RzWzUUiLuE
On 2021-09-28 at 10:44:02 +1000, Chris Angelico wrote: > On Tue, Sep 28, 2021 at 10:40 AM Skip Montanaro > wrote: > > > > Woo hoo! It's installed. The ultimate error was a missing turbojpeg.h > > file. Thank goodness for the apt-file command. I was able to track > > that down to the libturbojpeg

Re: OT: AttributeError

2021-09-28 Thread 2QdxY4RzWzUUiLuE
On 2021-09-29 at 11:38:22 +1300, dn via Python-list wrote: > For those of us who remember/can compute in binary, octal, hex, or > decimal as-needed: > Why do programmers confuse All Hallows'/Halloween for Christmas Day? That one is also very old. (Yes, I know the answer. No, I will not spoil i

Re: OT: AttributeError

2021-09-28 Thread 2QdxY4RzWzUUiLuE
On 2021-09-29 at 09:21:34 +1000, Chris Angelico wrote: > On Wed, Sep 29, 2021 at 9:10 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2021-09-29 at 11:38:22 +1300, > > dn via Python-list wrote: > > > > > For those of us who remember/can compute in binary, octal, hex, or > > > decimal a

Re: OT: AttributeError

2021-09-28 Thread 2QdxY4RzWzUUiLuE
On 2021-09-29 at 09:21:34 +1000, Chris Angelico wrote: > ... read off a hex dump and see E8 > 03 and instantly read it as "1,000 little-endian". ITYM 000,1 little-endian. ;-) (Or possibly 000.1, depending on your locale.) -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntax not understood

2021-11-04 Thread 2QdxY4RzWzUUiLuE
On 2021-11-04 at 14:36:48 -0400, David Lowry-Duda wrote: > > x_increment, y_increment = (scale * i for i in srcpages.xobj_box[2:]) > > > > (scale * i for i in srcpages.xobj_box[2:]) is a generator, a single > > object, it should not be possible to unpack it into 2 variables. > > If you know the

Re: Syntax not understood

2021-11-04 Thread 2QdxY4RzWzUUiLuE
On 2021-11-05 at 06:28:34 +1100, Chris Angelico wrote: > On Fri, Nov 5, 2021 at 6:23 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2021-11-04 at 14:36:48 -0400, > > David Lowry-Duda wrote: > > > > > > x_increment, y_increment = (scale * i for i in srcpages.xobj_box[2:]) > > > > > > >

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-18 Thread 2QdxY4RzWzUUiLuE
On 2021-11-18 at 23:16:32 -0300, René Silva Valdés wrote: > Hello, I would like to report the following issue: > > Working with floats i noticed that: > > int(23.99/12) returns 1, and > int(23.999/12) returns 2 > > This implies that int() function is rounding ... It's

Re: Why operations between dict views return a set and not a frozenset?

2022-01-04 Thread 2QdxY4RzWzUUiLuE
On 2022-01-05 at 08:30:30 +1100, Cameron Simpson wrote: > On 04Jan2022 21:03, Marco Sulla wrote: > >On Tue, 4 Jan 2022 at 19:38, Chris Angelico wrote: > >> [...] should the keys view be considered > >> frozen or not? Remember the set of keys can change (when the > >> underlying dict changes). >

Re: AttributeError: 'NoneType' object has no attribute 'get'

2022-01-06 Thread 2QdxY4RzWzUUiLuE
On 2022-01-06 at 14:21:48 -0700, Mats Wichmann wrote: > And at a more meta level: many functions in the Python world return > None as an indication that the operation did not succeed. It's useful > because in many circumstances None is an "out of band" value - one > that could not happen natura

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread 2QdxY4RzWzUUiLuE
On 2022-02-03 at 12:39:43 +1100, Cameron Simpson wrote: > You have: > > def _check_interval(self, interval): > if not type(interval) in [int, float]: > raise TypeError('{} is not numeric'.format(interval)) > > This check is better written: > > if not isinstance(inte

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread 2QdxY4RzWzUUiLuE
On 2022-02-03 at 15:07:22 +1100, Chris Angelico wrote: > On Thu, 3 Feb 2022 at 14:52, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2022-02-03 at 12:39:43 +1100, > > Cameron Simpson wrote: > > > > > You have: > > > > > > def _check_interval(self, interval): > > > if not type

Re: Waht do you think about my repeated_timer class

2022-02-03 Thread 2QdxY4RzWzUUiLuE
On 2022-02-03 at 05:52:19 +0100, Cecil Westerhof via Python-list wrote: > 2qdxy4rzwzuui...@potatochowder.com writes: > > > FWIW, I'd find some way to tell users the units (seconds, milliseconds, > > fortnights, etc.) instead of making them wade through your code to find > > the call to (and poss

Re: Best way to check if there is internet?

2022-02-07 Thread 2QdxY4RzWzUUiLuE
On 2022-02-08 at 06:51:20 +1100, Chris Angelico wrote: > Either way, though: would a person on Mars "have the internet"? Yes, > but not the internet as we know it... By current definition, they *can't* have the internet as we know it. Wikipedia,¹ Mirrian-Webster,² and TechTerms.com³ (the first

Re: Best way to check if there is internet?

2022-02-22 Thread 2QdxY4RzWzUUiLuE
On 2022-02-09 at 11:15:34 +0400, Abdur-Rahmaan Janhangeer wrote: > I think for me having the internet means ability to request urls You can always ask. The real question is what will the response be? ;-) This entire exercise is a race condition, just like checking for that a file exists befor

Re: Best way to check if there is internet?

2022-02-23 Thread 2QdxY4RzWzUUiLuE
On 2022-02-23 at 09:28:40 -0700, Akkana Peck wrote: > 2qdxy4rzwzuui...@potatochowder.com writes: > > I think someone said it way upthread: don't check, just do whatever you > > came to do, and it will work or it will fail (presumably, your program > > can tell the difference, regardless of a pas

Re: Best way to check if there is internet?

2022-02-25 Thread 2QdxY4RzWzUUiLuE
On 2022-02-25 at 13:48:32 -0600, "Michael F. Stemper" wrote: > On 25/02/2022 12.07, Abdur-Rahmaan Janhangeer wrote: > > I have been following language feature proposals from various > > languages. Some decide to avoid Python's route, but others have been > > trying hard to catch up with Python.

Re: All permutations from 2 lists

2022-03-01 Thread 2QdxY4RzWzUUiLuE
On 2022-03-01 at 19:12:10 -0500, Larry Martell wrote: > If I have 2 lists, e.g.: > > os = ["Linux","Windows"] > region = ["us-east-1", "us-east-2"] > > How can I get a list of tuples with all possible permutations? > > So for this example I'd want: > > [("Linux", "us-east-1"), ("Linux", "us-e

Re: Behavior of the for-else construct

2022-03-04 Thread 2QdxY4RzWzUUiLuE
On 2022-03-04 at 11:14:29 -0500, Dennis Lee Bieber wrote: > Try to tell the difference between > > afileand > afile > > when doing a directory listing. Easy: log in over a 110 baud modem, where the characters take almost as much time as the beep. ;-) -- https://mail.python

Re: Best practice for caching hash

2022-03-12 Thread 2QdxY4RzWzUUiLuE
On 2022-03-12 at 21:45:56 +0100, Marco Sulla wrote: [ ... ] > So if I do not cache if the object is unhashable, I save a little > memory per object (1 int) and I get a better error message every time. > On the other hand, if I leave the things as they are, testing the > unhashability of the obj

Re: dict.get_deep()

2022-04-03 Thread 2QdxY4RzWzUUiLuE
On 2022-04-03 at 18:01:58 +0300, Kirill Ratkin via Python-list wrote: > It seems 'case if' should help with types: > > case {"users": [{"address": {"street": street}}]} if isinstance(street, > str): reduce(lambda x, y: x[y], ["users", 0, "address", "street"], data) Unless it's y[x] rather than

Re: Comparing sequences with range objects

2022-04-10 Thread 2QdxY4RzWzUUiLuE
On 2022-04-10 at 22:20:33 +0200, Antoon Pardon wrote: > > > Op 9/04/2022 om 02:01 schreef duncan smith: > > On 08/04/2022 22:08, Antoon Pardon wrote: > > > > > > Well my first thought is that a bitset makes it less obvious to calulate > > > the size of the set or to iterate over its elements.

Re: Unable to login | fbchat.Client

2020-07-11 Thread 2QdxY4RzWzUUiLuE
On 2020-07-11 at 12:56:22 +0530, Shivam Dutt Sharma wrote: > *Logging in xx.x.xx... > Attempt #1 failed, retrying > Traceback (most recent call last): > File "C:\Users\my\Anaconda3\lib\site-packages\fbchat\_client.py", > line 209, in login > user_agent=user_agent, > File "C:\Users

Re: Symlinks already present

2020-07-27 Thread 2QdxY4RzWzUUiLuE
On 2020-07-27 at 20:20:08 +0200, Termoregolato wrote: > Il 26/07/20 20:39, Dennis Lee Bieber ha scritto: > > > Since symbolic links are essentially just short files containing the > > path to the eventual target file/directory, with an OS flag that the file > > is a link > > Yes, I use them mas

Re: Non IDE development strategy - what do others do that's fairly simple?

2020-07-29 Thread 2QdxY4RzWzUUiLuE
On 2020-07-29 at 11:20:42 +0100, Chris Green wrote: > I have a few python programs that I have written which I need to do > some fairly extensive changes to (to get from gtk to gobject and to > move to Python 3). This is on a Linux (xubuntu 20.04) system. I use > the command line to do just abo

Re: questions re: calendar module

2020-08-02 Thread 2QdxY4RzWzUUiLuE
On 2020-08-02 at 06:26:10 -0500, o1bigtenor wrote: > On Sat, Aug 1, 2020 at 11:33 PM dn via Python-list > wrote: > > The fact that some months have fewer, or more, weeks to include, is > > largely irrelevant. The solution is a standard "merge" algorithm. (us > > 'silver surfers' cut our teeth o

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-06 Thread 2QdxY4RzWzUUiLuE
On 2020-08-07 at 04:00:34 +1000, Regarding "Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?," Chris Angelico wrote: > On Fri, Aug 7, 2020 at 2:36 AM Christian Seberino wrote: > > > > On Thursday, August 6, 2020 at 10:52:00 AM UTC-5, Chris Angelico wrote:

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-06 Thread 2QdxY4RzWzUUiLuE
On 2020-08-07 at 05:22:53 +1000, Chris Angelico wrote: > On Fri, Aug 7, 2020 at 5:10 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > One thing worth noting is that your mental pseudo-code is affected by > the languages you're comfortable with. You said: > > > create a new list in which each va

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-06 Thread 2QdxY4RzWzUUiLuE
On 2020-08-06 at 16:08:29 -0700, Christian Seberino wrote: > > Trying to maintain that recursive list of unclosed lists in your > > brain is fun. It stretches the brain in interesting ways. I was > > way into Lisp at one point, including writing several Lisp > > interpreters (that simple structur

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-06 Thread 2QdxY4RzWzUUiLuE
On 2020-08-06 at 20:07:05 -0700, Christian Seberino wrote: > Some problems are well suited to recursion but perhaps //most// > problems are better suited to iteration? > Maybe the spread is 10% vs 90%? Citation needed? > Therefore in general more often the Python way seems simpler than Lisp?

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread 2QdxY4RzWzUUiLuE
On 2020-08-07 at 17:55:45 +0200, Marco Sulla wrote: > On Fri, 7 Aug 2020 at 17:14, Christian Seberino wrote: > Commonly, in imperative languages like C, you can write > > if (a = b) {...} > > This is allowed in C, even if a = b is not an expression ... In C, a = b *is* an expression. An ass

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread 2QdxY4RzWzUUiLuE
On 2020-08-07 at 10:00:25 -0600, Akkana Peck wrote: > I wrote: > > > > Trying to maintain that recursive list of unclosed lists in your > > > > brain is fun. It stretches the brain in interesting ways. > > > > [ ... ] But I never found Lisp code very maintainable, [ ... ] > > 2qdxy4rzwzuui...@po

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread 2QdxY4RzWzUUiLuE
On 2020-08-07 at 11:02:50 -0700, Christian Seberino wrote: > > In Lisp, your hammer is the list. > > > In, say, Java, your tool is classes and inheritance. > > And yet if Lisp or Java programmers were here they would say their > languages //are// multi-paradigm too. For example, Lisp has the >

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread 2QdxY4RzWzUUiLuE
On 2020-08-07 at 21:54:35 +0200, Marco Sulla wrote: > On Fri, 7 Aug 2020 at 19:48, Richard Damon wrote: > Christian Seberino just expressed a doubt about how a clear separation > between a statement and an expression is quite desiderable in the > "real" programming world. And I tried to explain

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread 2QdxY4RzWzUUiLuE
On 2020-08-07 at 13:43:06 -0500, Wyatt Biggs wrote: > > It's also probably significantly slower, so you'd likely still want to > > use the iterative version > > Generalizing this to the majority of recursive functions/methods, are > their iterative counterparts more efficient? (I say "majority o

Re: Symlinks already present

2020-08-07 Thread 2QdxY4RzWzUUiLuE
On 2020-08-08 at 01:58:13 +0200, Termoregolato wrote: > me@debsrv:~/tmp/test$ stat --format=%i /home/me/mydir > 18481153 Try ls -i. :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: Any ideas for a new language inspired to Python?

2020-08-09 Thread 2QdxY4RzWzUUiLuE
On 2020-08-09 at 13:07:03 -0400, Dennis Lee Bieber wrote: > On Sun, 9 Aug 2020 09:31:04 +0100, Barry Scott > declaimed the following: > > > > >By going to C you are really saying you want to use the native instructions > >of your CPU. > >Contrast that with bytecode that needs an interpreter. >

Re: Any ideas for a new language inspired to Python?

2020-08-09 Thread 2QdxY4RzWzUUiLuE
On 2020-08-10 at 09:02:57 +1000, Chris Angelico wrote: > If you *really* want to get away from ints-as-objects, what I would > recommend is emulating it. Some languages pretend that everything's an > object, but for small integers (say, those less than 2**60), it > doesn't store the object itself

Re: Output showing "None" in Terminal

2020-08-24 Thread 2QdxY4RzWzUUiLuE
On 2020-08-24 at 06:12:11 -0700, Py Noob wrote: > i'm new to python and would like some help with something i was working on > from a tutorial. I'm using VScode with 3.7.0 version on Windows 7. Below is > my code and the terminal is showing the word "None" everytime I execute my > code. > if sel

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread 2QdxY4RzWzUUiLuE
On 2020-08-26 at 14:22:10 +0100, Chris Green wrote: > I have the following line in Python 2:- > > msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list > containing the lines of the message > > ... so I changed it to:- > > s = "\n" > msgstr = s.join(popmsg[1]) # po

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread 2QdxY4RzWzUUiLuE
On 2020-08-26 at 22:10:26 +0200, Marco Sulla wrote: > As title ... Assuming that the title appears prominently with the content of your email. For the rest of us: Why __hash__() does not return an UUID4? > ... The reasons that came in my mind are: > > 1. speed > 2. security Correctness?

Re: Fwd: Issue in installing Python (Windows 10)

2020-08-28 Thread 2QdxY4RzWzUUiLuE
On 2020-08-28 at 18:38:03 -0500, Debasis Chatterjee wrote: > By the way, is there a site where I can login to see such mails and > also manage mail notification options? Better than that, you can have the emails themselves delivered directly to your inbox: https://mail.python.org/mailman/listin

Re: Puzzling difference between lists and tuples

2020-09-17 Thread 2QdxY4RzWzUUiLuE
On 2020-09-17 at 09:24:57 -0600, William Pearson wrote: > for n in ('first'): That's not a tuple. That's a string. Try it this way: for n in ('first',): # note the trailing comma print n Dan -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-26 Thread 2QdxY4RzWzUUiLuE
On 2020-09-27 at 03:36:48 +0800, Stephane Tougard via Python-list wrote: > Anyway, there's no perfect language, the point is to know it ... Yes. > ... It's just confusing I still have to declare or not declare an > object depending on the action I have with it. As ChrisA noted, Python almost a

Re: Use of a variable in parent loop

2020-09-27 Thread 2QdxY4RzWzUUiLuE
On 2020-09-27 at 15:18:44 +0800, Stephane Tougard via Python-list wrote: > In many non declarative language, if I do print($var), it just prints > and undefined value with returning an error. If I want "many non declarative language[s]," I know where to find them, and I won't expect them to hono

Re: error in install.sh

2020-09-30 Thread 2QdxY4RzWzUUiLuE
On 2020-09-30 at 13:27:43 +0100, RobH wrote: > I had to do a reinstall of my linux system due to a faulty ssd, and have a > problem with a install.sh script.The said script is included in with lcd > files. which I downloaded from github. > > When I run ./install.sh, it fails at > ./install.sh: l

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread 2QdxY4RzWzUUiLuE
On 2020-10-16 at 10:59:16 +1100, Samuel Marks wrote: > --optimizer Adam,learning_rate=0.01,something_else=3 > > That syntax isn’t so bad! =] > > How would you suggest the help text for this looks? (don’t worry about > implementation, just what goes to stdout/stderr) --optimizer name[,optio

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread 2QdxY4RzWzUUiLuE
On 2020-10-16 at 10:20:40 +1100, Cameron Simpson wrote: > On 16Oct2020 10:09, Samuel Marks wrote: > >Yes it’s my module, and I’ve been using argparse > >https://github.com/SamuelMarks/ml-params > > > >No library I’ve found provides a solution to CLI argument parsing for my > >use-case. Out of c

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread 2QdxY4RzWzUUiLuE
On 2020-10-16 at 11:27:56 +1100, Regarding "Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?," Samuel Marks wrote: > The feature that existing CLI parsers are missing is a clean syntax > for specifying options on the second parameter (the "value"), wher

Re: GUI (tkinter) popularity and job prospects for

2020-10-22 Thread 2QdxY4RzWzUUiLuE
On 2020-10-22 at 12:50:43 -0700, Rich Shepard wrote: > On Thu, 22 Oct 2020, Lammie Jonson wrote: > > I looked at tkinter which seems to have quite a few examples out > > there, but when I searched indeed.com for tkinter and wxpython it > > appeared that there was hardly any job listings mentioni

Re: Best way to determine user's screensize?

2020-10-30 Thread 2QdxY4RzWzUUiLuE
On 2020-10-30 at 20:47:50 -0400, songbird wrote: > Chris Angelico wrote: > ... > > I add my voice to those who detest applications that think they know > > best and decide that they own the entire screen. It is incredibly > > annoying. > > do you object to a window being put in the approximate

Re: Best way to determine user's screensize?

2020-10-31 Thread 2QdxY4RzWzUUiLuE
On 2020-10-31 at 13:02:03 +0100, "Peter J. Holzer" wrote: > On 2020-10-31 12:30:43 +1100, Chris Angelico wrote: > > There is no valid way for an application to read my mind and size > > itself. Attempting to query my screen size seems to just make things > > worse in a lot of situations. > You

Re: Best way to determine user's screensize?

2020-10-31 Thread 2QdxY4RzWzUUiLuE
On 2020-10-31 at 14:37:52 +0100, "Peter J. Holzer" wrote: > On 2020-10-31 07:51:38 -0500, 2qdxy4rzwzuui...@potatochowder.com wrote: > > The intial/default window should be big enough to contain the > > initial/default content, regardless of the configuration of the > > screen(s)/monitor(s). > >

Re: Best way to determine user's screensize?

2020-10-31 Thread 2QdxY4RzWzUUiLuE
On 2020-10-31 at 19:24:34 +0100, "Peter J. Holzer" wrote: > On 2020-10-31 11:58:41 -0500, 2qdxy4rzwzuui...@potatochowder.com wrote: > > On 2020-10-31 at 14:37:52 +0100, > > "Peter J. Holzer" wrote: > > > > > On 2020-10-31 07:51:38 -0500, 2qdxy4rzwzuui...@potatochowder.com wrote: > > > > > > Th

Re: returning totals in functions of math

2020-11-08 Thread 2QdxY4RzWzUUiLuE
On 2020-11-08 at 19:00:34 +, Peter Pearson wrote: > On Sun, 8 Nov 2020 13:50:19 -0500, Quentin Bock wrote: > > Errors say that add takes 1 positional argument but 3 were given? Does this > > limit how many numbers I can have or do I need other variables? > > Here is what I have: > > def add(

Re: Class Definitions

2020-11-14 Thread 2QdxY4RzWzUUiLuE
On 2020-11-14 at 10:09:32 +0100, Manfred Lotz wrote: > On 11 Nov 2020 19:21:57 GMT > r...@zedat.fu-berlin.de (Stefan Ram) wrote: > > > In my Python course I gave the assignment to define a > > counter class "Main" so that > > > > counter0 = Main() > > counter1 = Main() > > counter1.count();

Re: To check if number is in range(x,y)

2020-12-12 Thread 2QdxY4RzWzUUiLuE
On 2020-12-12 at 10:51:00 -0600, Tim Chase wrote: > If you want numeric-range checks, Python provides the lovely > double-comparison syntax: > > >>> x = 5 > >>> 2 < x < 10 > True Not just numbers: >>> 'm' < 'n' < 'o' True >>> 'one' < 'one point five' < 'two' True Okay,

Re: To check if number is in range(x,y)

2020-12-14 Thread 2QdxY4RzWzUUiLuE
On 2020-12-14 at 21:21:43 +, "Schachner, Joseph" wrote: > >>> r = range(10) > So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 In a number of ways, r behaves as if it were that list, but r is definitely not that list: >>> r = range(10) >>> type(r) >>> l = [0, 1, 2, 3,

Re: Library for text substitutions with calculations?

2020-12-15 Thread 2QdxY4RzWzUUiLuE
On 2020-12-15 at 16:04:55 +0100, Jan Erik Moström wrote: > I want to do some text substitutions but a bit more advanced than what > string.Template class can do. I addition to plain text substitution I would > like to be able to do some calculations: > > $value+1 - If value is 16 this would inse

Re: dict.get(key, default) evaluates default even if key exists

2020-12-15 Thread 2QdxY4RzWzUUiLuE
On 2020-12-16 at 12:01:01 +1300, dn via Python-list wrote: > > On Tue, Dec 15, 2020 at 9:57 AM Mark Polesky via Python-list < > > python-list@python.org> wrote: > > > >> Hi. > >> > >> # Running this script > >> > >> D = {'a':1} > >> def get_default(): > >> print('Nobody expects this') >

Re: sudo python PermissionError [Errno 13] Permission denied

2020-12-17 Thread 2QdxY4RzWzUUiLuE
On 2020-12-17 at 11:17:37 +0100, Pascal wrote: > hi, > > here, I have this simple script that tests if the /tmp/test file can be > opened in write mode : > > $ cat /tmp/append > #!/usr/bin/python > with open('/tmp/test', 'a'): pass > > the file does not exist yet : > > $ chmod +x /tmp/append

Re: Messed up syntax in Vim when pasting python code to post to the groups.

2020-12-17 Thread 2QdxY4RzWzUUiLuE
On 2020-12-17 at 16:20:16 -, Bischoop wrote: > I've being asked not to use external links for code sharing to the > groups but when I paste the code in to my vim editor I do use with > slrn client the code is just messed up. > How dear people people using vim solved this? I'm not a vim user

Re: dict.get(key, default) evaluates default even if key exists

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-19 at 22:29:34 +0100, Roel Schroeven wrote: > What could be useful in some use cases, I think, is a wrapper function > that evaluates the function lazily: > > def dict_get_lazily(d, key, fnc, *args, **kwargs): > try: > return d[key] > except KeyError: >

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-20 at 16:02:53 +, Regarding "Re: How do you find what exceptions a class can throw?," Chris Green wrote: > Stefan Ram wrote: > > Chris Green writes: > > >I am using poplib.POP3_SSL() and I want to know what exceptions can be > > >thrown when I instantiate it. Presumably it inher

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-20 at 18:25:40 -, Grant Edwards wrote: > On 2020-12-20, 2qdxy4rzwzuui...@potatochowder.com > <2qdxy4rzwzuui...@potatochowder.com> wrote: > > Chris Green wrote: > > > >>> Ultimately, it is not possible to tell what exceptions > >>> a call might throw. > > While it may not be

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-20 at 21:46:48 -0500, Avi Gross via Python-list wrote: [...] > I would say it is a more laudable goal for each function to publish > what interrupts they do NOT handle that might come through and perhaps > why ... I'm not disagreeing. Documenting important decisions and the reasons

Re: using regex for password validation

2020-12-23 Thread 2QdxY4RzWzUUiLuE
On 2020-12-24 at 11:41:15 +1300, dn via Python-list wrote: > On 24/12/2020 06:03, Sadaka Technology wrote: > > hello guys, > > > > I have this pattern for password validation (regex): [...] > > passwordpattern = > > "^(?=.[a-z])(?=.[A-Z])(?=.\d)(?=.[@$])[A-Za-z\d@$!%?&]{8,}.$" > > > > my onl

Re: Control stript which is runing in background.

2020-12-31 Thread 2QdxY4RzWzUUiLuE
On 2021-01-01 at 00:45:52 +0100, Regarding "Re: Control stript which is runing in background.," jak wrote: > ... but this won't be the problem the OP may encounter if its intention is > to create a script to command another one that is running. It will be > sufficient to limit the write permissio

Re: Control stript which is runing in background.

2020-12-31 Thread 2QdxY4RzWzUUiLuE
On 2021-01-01 at 03:43:43 +0100, Regarding "Re: Control stript which is runing in background.," jak wrote: > Il 01/01/2021 01:43, Cameron Simpson ha scritto: > > On 01Jan2021 01:21, jak wrote: > > > Il 01/01/2021 00:58, 2qdxy4rzwzuui...@potatochowder.com ha scritto: > > > > Most of the time, I h

Re: Control stript which is runing in background.

2021-01-01 Thread 2QdxY4RzWzUUiLuE
On 2021-01-01 at 11:11:47 +0100, jak wrote: > Il 01/01/2021 04:14, 2qdxy4rzwzuui...@potatochowder.com ha scritto: > > On 2021-01-01 at 03:43:43 +0100, > > jak wrote: > > > > I think you were clear enough before, but you may not have > > considered things the OP did not specify. One of the hard

Re: Control stript which is runing in background.

2021-01-01 Thread 2QdxY4RzWzUUiLuE
On 2021-01-01 at 21:41:24 +0100, jak wrote: > Sorry if I made you argumentative ... And I didn't mean to be argumentative. :-) We both offered alternatives, and we both argued for them (in the sense of claiming that our own ideas were good). Each solution is better, depending on certain detai

Re: Tkinter menu item underline syntax

2021-01-06 Thread 2QdxY4RzWzUUiLuE
On 2021-01-06 at 10:32:58 -0800, Rich Shepard wrote: > My application's menu has lines like this: > file_menu.add_command( > label = 'New', > command = self.callbacks['file->new', underline 0], > accelerator = 'Ctrl+N' > ) > > Python reports a

Re: Tkinter menu item underline syntax [RESOLVED]

2021-01-06 Thread 2QdxY4RzWzUUiLuE
On 2021-01-06 at 11:18:15 -0800, Rich Shepard wrote: > On Wed, 6 Jan 2021, 2qdxy4rzwzuui...@potatochowder.com wrote: > > > I'm not a TKinter expert (nor even a current user), but that line that > > begins with whitespace and "command =" looks suspicious. As far as I can > > see, Python is correc

Re: learning python building 2nd app, need advices

2021-01-11 Thread 2QdxY4RzWzUUiLuE
On 2021-01-11 at 06:34:42 -0800, pascal z via Python-list wrote: > On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote: > > Easy fix: stop looking at the Google Group page. > > > > ChrisA > ok, emails show post fine. 10 years ago or something, I was quite > involved to comp.lan

<    1   2