Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-27 Thread Grant Edwards via Python-list
On 2024-05-26, Gilmeh Serda via Python-list wrote: > The web claims (I think on all pages I've read about Markdown and Python) > that this code should work, with some very minor variants on the topic: > > ```python > > import os > > with open(os.path.join('/home/user/apath', 'somefile')) as f: >

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Barry via Python-list wrote: > > >> On 18 May 2024, at 16:27, Peter J. Holzer via Python-list >> wrote: >> >> I don't think Linux users have to deal with venvs > > Modern debian (ubuntu) and fedora block users installing using pip. You can't even use pip to do "user" installs?

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Gilmeh Serda via Python-list wrote: > On Sun, 19 May 2024 08:32:46 +0100, Alan Gauld wrote: > >> I've honestly never experienced this "nightmare". >> I install stuff and it just works. > > Hear! Hear! Me too! And all that. > > I'm on Manjaro, which is a tad finicky about other

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Alan Gauld via Python-list wrote: >> The dependency nightmare created by python, pip >> and all the rest cannot be resolved otherwise. > > I've honestly never experienced this "nightmare". > I install stuff and it just works. Same here. I occasonlly use pip to install something

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-18 Thread Grant Edwards via Python-list
On 2024-05-18, Mats Wichmann via Python-list wrote: > Distros have do offer a good selection of packaged Python bits, yes, but > only for the version of Python that's "native" to that distro release. > If you need to test other versions of Python, you're mostly on your own. For a few years I

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-18 Thread Grant Edwards via Python-list
On 2024-05-18, Peter J. Holzer via Python-list wrote: > On 2024-05-16 19:46:07 +0100, Gordinator via Python-list wrote: > >> To be fair, the problem is the fact that they use Windows (but I >> guess Linux users have to deal with venvs, so we're even. > > I don't think Linux users have to deal

Re: Terminal Emulator

2024-05-14 Thread Grant Edwards via Python-list
On 2024-05-14, Alan Gauld via Python-list wrote: > On 14/05/2024 18:44, Gordinator via Python-list wrote: > >> I wish to write a terminal emulator in Python. I am a fairly >> competent Python user, and I wish to try a new project idea. What >> references can I use when writing my terminal

Re: Terminal Emulator

2024-05-14 Thread Grant Edwards via Python-list
On 2024-05-14, Alan Gauld via Python-list wrote: > On 14/05/2024 18:44, Gordinator via Python-list wrote: > >> I wish to write a terminal emulator in Python. I am a fairly >> competent Python user, and I wish to try a new project idea. What >> references can I use when writing my terminal

Re: How to Add ANSI Color to User Response

2024-04-10 Thread Grant Edwards via Python-list
On 2024-04-10, Alan Gauld via Python-list wrote: > On 10/04/2024 19:50, WordWeaver Evangelist via Python-list wrote: > >> I have a simple question. I use the following textPrompt in some of my >> Jython modules: >> '\nYour choice is? (A B C D E): ', maxChars=1, autoAccept=False, >>

Re: How to Add ANSI Color to User Response

2024-04-10 Thread Grant Edwards via Python-list
On 2024-04-10, WordWeaver Evangelist via Python-list wrote: > I have a simple question. I use the following textPrompt in some of my Jython > modules: > '\nYour choice is? (A B C D E): ', maxChars=1, autoAccept=False, > forceUppercase=True) > Is there a way to add an ANSI color code

Re: Popping key causes dict derived from object to revert to object

2024-03-25 Thread Grant Edwards via Python-list
On 2024-03-25, Loris Bennett via Python-list wrote: > Grant Edwards writes: > >> On 2024-03-22, Loris Bennett via Python-list wrote: >> >>> Yes, I was mistakenly thinking that the popping the element would >>> leave me with the dict minus the popped key-v

Re: Popping key causes dict derived from object to revert to object

2024-03-22 Thread Grant Edwards via Python-list
On 2024-03-22, Loris Bennett via Python-list wrote: > Yes, I was mistakenly thinking that the popping the element would > leave me with the dict minus the popped key-value pair. It does. > Seem like there is no such function. Yes, there is. You can do that with either pop or del: >>> d =

Re: the name ``wheel''

2024-03-21 Thread Grant Edwards via Python-list
On 2024-03-21, MRAB via Python-list wrote: > As it's recommended to use the Python Launcher py on Windows, I use > that instead: > > py -m pip install something > > because it gives better support if you have multiple versions of > Python installed. I adopted that practice years ago on Linux as

Re: Configuring an object via a dictionary

2024-03-15 Thread Grant Edwards via Python-list
On 2024-03-15, Thomas Passin via Python-list wrote: > On 3/15/2024 5:30 AM, Loris Bennett via Python-list wrote: >> Hi, >> >> I am initialising an object via the following: >> >> def __init__(self, config): >> >> self.connection = None >> >> self.source_name =

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Thomas Passin via Python-list wrote: > >> Hi, I tested this with Python 3.8. Good to know that this was fixed! > > We just learned a few posts back that it might be specific to Linux; I > ran it on Windows. On Linux, the limit is imposed by the filesystem. Most of the "real"

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Grant Edwards via Python-list wrote: >> OSError: [Errno 36] File name to

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Grant Edwards via Python-list wrote: > On 2024-03-08, Thomas Passin via Python-list wrote: >> On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: >>> Hi, >>> I was replacing some os.path stuff with Pathlib and I discovered this: >

Re: pathlib.Path.is_file vs os.path.isfile difference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Thomas Passin via Python-list wrote: > On 3/8/2024 1:03 PM, Albert-Jan Roskam via Python-list wrote: >> Hi, >> I was replacing some os.path stuff with Pathlib and I discovered this: >> Path(256 * "x").is_file() # OSError >> os.path.isfile(256 * "x") # bool >>

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-08, Chris Angelico via Python-list wrote: > On Sat, 9 Mar 2024 at 00:51, Grant Edwards via Python-list > wrote: > >> One might argue that "global" isn't a good choice for what to call the >> scope in question, since it's not global. It's limited to that

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-08 Thread Grant Edwards via Python-list
On 2024-03-07, Cameron Simpson via Python-list wrote: > Yes. Note that the "global" namespace is the module in which the > function is defined. One might argue that "global" isn't a good choice for what to call the scope in question, since it's not global. It's limited to that source file. It

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-06 Thread Grant Edwards via Python-list
On 2024-03-07, dn via Python-list wrote: > The idea of importing a module into the REPL and then (repeatedly) > manually entering the code to set-up and execute is unusual (surely type > such into a script (once), and run that (repeatedly). As you say, most > of us would be working from an

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-06 Thread Grant Edwards via Python-list
On 2024-03-06, Roel Schroeven via Python-list wrote: > Op 6/03/2024 om 17:40 schreef Jacob Kruger via Python-list: >> >>> from scoping2 import * > > [...] > > I would advice not to use 'import *', if at all possible, for multiple > reasons, one of which is to prevent problems like this.

Re: Can u help me?

2024-03-06 Thread Grant Edwards via Python-list
On 2024-03-06, MRAB via Python-list wrote: > On 2024-03-06 01:44, Ethan Furman via Python-list wrote: >> On 3/5/24 16:49, MRAB via Python-list wrote: >> > On 2024-03-06 00:24, Ethan Furman via Python-list wrote: >> >> On 3/5/24 16:06, Chano Fucks via Python-list wrote: >> >> >> >>>

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-05 Thread Grant Edwards via Python-list
On 2024-03-05, Cameron Simpson via Python-list wrote: > Because there are no variable definitions in Python, when you write > a function Python does a static analysis of it to decide which > variables are local and which are not. If there's an assignment to a > variable, it is a local variable.

Re: Problem resizing a window and button placement

2024-02-24 Thread Grant Edwards via Python-list
On 2024-02-24, MRAB via Python-list wrote: > On 2024-02-24 01:14, Steve GS via Python-list wrote: > >> Python, Tkinter: How do I determine if a window has been resized? I >> want to locate buttons vertically along the right border and need >> to know the new width. The buttons are to move with

Re: Can one output something other than 'nan' for not a number values?

2024-02-19 Thread Grant Edwards via Python-list
On 2024-02-19, Chris Green via Python-list wrote: > It's using f'{...}' at the moment. Here's a demonstration of how to hook custom code into the f-string formatting engine. It's brilliantly depraved.

Re: Testing (sorry)

2024-02-19 Thread Grant Edwards via Python-list
On 2024-02-19, Thomas Passin wrote: >> About 24 hours later, all of my posts (and the confirmation e-mails) >> all showed up in a burst at the same time on two different unrelated >> e-mail accounts. >> >> I still have no clue what was going on... > > Sometimes a post of mine will not show up

Re: Testing (sorry)

2024-02-18 Thread Grant Edwards via Python-list
On 2024-02-18, Peter J. Holzer via Python-list wrote: > [Replying to the list *and* Grant] > > On 2024-02-17 19:38:04 -0500, Grant Edwards via Python-list wrote: >> Today I noticed that nothing I've posted to python-list in past 3 >> weeks has shown up on the list. >

Testing (sorry)

2024-02-18 Thread Grant Edwards via Python-list
Today I noticed that nothing I've posted to python-list in the past 3 weeks has shown up on the list. I don't know how to troubleshoot this other than by sending test messages. Obviously, if this shows up on the list, then I'm making progress... [message 3] -- Grant --

Testing (sorry)

2024-02-18 Thread Grant Edwards via Python-list
Today I noticed that nothing I've posted to python-list in past 3 weeks has shown up on the list. I don't know how to troubleshoot this other than sending test messages. Obviously, if this shows up on the list, then I'm making progress. [message 4] -- Grant --

Testing - 2 (sorry)

2024-02-18 Thread Grant Edwards via Python-list
Today I noticed that nothing I've posted to python-list in past 3 weeks has shown up on the list. I don't know how to troubleshoot this other than sending test messages. Obviously, if this shows up on the list, then I've gotten it to work... -- Grant --

Testing (sorry)

2024-02-18 Thread Grant Edwards via Python-list
Today I noticed that nothing I've posted to python-list in past 3 weeks has shown up on the list. I don't know how to troubleshoot this other than sending test messages. Obviously, if this shows up on the list, then I've gotten it to work... -- Grant --

Re: Can one output something other than 'nan' for not a number values?

2024-02-18 Thread Grant Edwards via Python-list
On 2024-02-16, Chris Green wrote: > I'm looking for a simple way to make NaN values output as something > like '-' or even just a space instead of the string 'nan'. I tried monkey-patching the __format__ method of float, but it's immutable, so that didnt' work. Is float.__format__ what's used

Can one output something other than 'nan' for not a number values?

2024-02-18 Thread Grant Edwards via Python-list
[I've been trying all afternoon to post via slrn, but nothing is showing up on the list. Forgive me if multiple posts eventually show up.] On 2024-02-17, Cameron Simpson via Python-list wrote: > On 16Feb2024 22:12, Chris Green wrote: >>I'm looking for a simple way to make NaN values output as

Can one output something other than 'nan' for not a number values?

2024-02-18 Thread Grant Edwards via Python-list
[Posts via slrn and my GMail account aren't showing up, so I guess I'll try subscribing from a different e-mail address.] On 2024-02-17, Cameron Simpson via Python-list wrote: On 16Feb2024 22:12, Chris Green wrote: I'm looking for a simple way to make NaN values output as something like

Re: Can one output something other than 'nan' for not a number values?

2024-02-18 Thread Grant Edwards via Python-list
On 2024-02-17, Cameron Simpson via Python-list wrote: > On 16Feb2024 22:12, Chris Green wrote: >>I'm looking for a simple way to make NaN values output as something >>like '-' or even just a space instead of the string 'nan'. [...] >> >>Battery Voltages and Currents >>Leisure Battery -

Re: Can one output something other than 'nan' for not a number values?

2024-02-18 Thread Grant Edwards via Python-list
On 2024-02-17, Cameron Simpson via Python-list wrote: > On 16Feb2024 22:12, Chris Green wrote: >>I'm looking for a simple way to make NaN values output as something >>like '-' or even just a space instead of the string 'nan'. [...] >> >>Battery Voltages and Currents >>Leisure Battery -

Re: Can one output something other than 'nan' for not a number values?

2024-02-18 Thread Grant Edwards via Python-list
On 2024-02-17, Cameron Simpson via Python-list wrote: > On 16Feb2024 22:12, Chris Green wrote: >>I'm looking for a simple way to make NaN values output as something >>like '-' or even just a space instead of the string 'nan'. [...] >> >>Battery Voltages and Currents >>Leisure Battery -

Re: Can one output something other than 'nan' for not a number values?

2024-02-18 Thread Grant Edwards via Python-list
On 2024-02-17, Cameron Simpson via Python-list wrote: > On 16Feb2024 22:12, Chris Green wrote: >>I'm looking for a simple way to make NaN values output as something >>like '-' or even just a space instead of the string 'nan'. >>[...] >> >>Battery Voltages and Currents >>Leisure Battery -

Re: Can one output something other than 'nan' for not a number values?

2024-02-18 Thread Grant Edwards via Python-list
On 2024-02-16, Chris Green via Python-list wrote: > I'm looking for a simple way to make NaN values output as something > like '-' or even just a space instead of the string 'nan'. It would probably help if you told us how you're "outputting" them now (the Python feaatures/functions used, not

Re: Extract lines from file, add to new files

2024-01-29 Thread Grant Edwards via Python-list
On 2024-01-29, Rich Shepard via Python-list wrote: > On Mon, 29 Jan 2024, Rich Shepard via Python-list wrote: > >> No, I hadn't ... but I am reading it now. > > Perhaps I missed the answer to my question when reading the io module. It > explains how to open/write/read files of text and binary

Re: How/where to store calibration values - written by program A, read by program B

2023-12-29 Thread Grant Edwards via Python-list
On 2023-12-28, Peter J. Holzer via Python-list wrote: > On 2023-12-28 05:20:07 +, rbowman via Python-list wrote: >> On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote: >> > The biggest caveat is that the shared variable MUST exist before it can >> > be examined or used (not surprising).

Re: How to enter multiple, similar, dictionaries?

2023-12-11 Thread Grant Edwards via Python-list
On 2023-12-11, Chris Green via Python-list wrote: > Is there a way to abbreviate the following code somehow? > > lv = {'dev':'bbb', 'input':'1', 'name':'Leisure volts'} > sv = {'dev':'bbb', 'input':'0', 'name':'Starter volts'} > la = {'dev':'bbb', 'input':'2', 'name':'Leisure Amps'} >

Re: Context without manager

2023-11-26 Thread Grant Edwards via Python-list
On 2023-11-27, Grant Edwards via Python-list wrote: > On 2023-11-26, Dieter Maurer via Python-list wrote: > >> If you do not have this case (e.g. usually if you open the file >> in a class's `__init__`), you do not use a context manager. > > He knows that. The OP wr

Re: Context without manager

2023-11-26 Thread Grant Edwards via Python-list
On 2023-11-26, Dieter Maurer via Python-list wrote: > If you do not have this case (e.g. usually if you open the file > in a class's `__init__`), you do not use a context manager. He knows that. The OP wrote that he wants to use that can _only_ be used by a context manager, but he wants that

Re: xor operator

2023-11-13 Thread Grant Edwards via Python-list
On 2023-11-14, Dom Grigonis via Python-list wrote: > >> Except the 'any' and 'all' builtins are _exactly_ the same as bitwise >> or and and applided to many bits. To do something "in line" with that >> using the 'xor' operator would return True for an odd number of True >> values and False for an

Re: xor operator

2023-11-13 Thread Grant Edwards via Python-list
On 2023-11-13, Dom Grigonis via Python-list wrote: > I am not asking. Just inquiring if the function that I described > could be useful for more people. > > Which is: a function with API that of `all` and `any` and returns > `True` if specified number of elements is True. I've got no objection

Re: xor operator

2023-11-13 Thread Grant Edwards via Python-list
On 2023-11-13, Dom Grigonis via Python-list wrote: > Hi All, > > I think it could be useful to have `xor` builtin, which has API similar to > the one of `any` and `all`. > > * Also, it could have optional second argument `n=1`, which > * indicates how many positives indicates `True` return. For

Re: Checking if email is valid

2023-11-07 Thread Grant Edwards via Python-list
On 2023-11-06, Greg Ewing via Python-list wrote: > On 7/11/23 7:45 am, Mats Wichmann wrote: >> Continuing with the example, if you have a single phone number field, or >> let a mobile number be entered in a field marked for landline, you will >> probably assume you can text to that number. > >

Re: Checking if email is valid

2023-11-05 Thread Grant Edwards via Python-list
On 2023-11-05, D'Arcy Cain via Python-list wrote: > On 2023-11-05 00:39, Grant Edwards via Python-list wrote: >> Definitely. Syntactic e-mail address "validation" is one of the most >> useless and widely broken things on the Interwebs. People who do >&

Re: Checking if email is valid

2023-11-04 Thread Grant Edwards via Python-list
On 2023-11-04, Michael Torrie via Python-list wrote: > On 11/4/23 02:51, Simon Connah via Python-list wrote: > >> Wow. I'm half tempted to make a weird email address to see how many >> websites get it wrong. In my experience, they don't have to be very weird at all. >> Thank you for the link. >

Re: Checking if email is valid

2023-11-03 Thread Grant Edwards via Python-list
On 2023-11-02, Michael Torrie via Python-list wrote: > On 11/2/23 00:42, Simon Connah via Python-list wrote: > >> Valid as in conforms to the standard. Although having looked at the >> standard that might be more difficult than originally planned. > > You'll have to read the relevant RFCs. Lots

Re: Checking if email is valid

2023-11-01 Thread Grant Edwards via Python-list
On 2023-11-01, Chris Angelico via Python-list wrote: > On Thu, 2 Nov 2023 at 08:09, Grant Edwards via Python-list > wrote: >> Make sure it has an '@' in it. Possibly require at least one '.' >> after the '@'. > > No guarantee that there'll be a dot after the at. Ah, I

Re: Checking if email is valid

2023-11-01 Thread Grant Edwards via Python-list
On 2023-11-01, Simon Connah via Python-list wrote: > I'm building a simple project using smtplib and have a > question. I've been doing unit testing but I'm not sure how to check > if an email message is valid. Send an e-mail using it? If the right person gets the e-mail, then it's valid? >

Re: Question(s)

2023-10-25 Thread Grant Edwards via Python-list
On 2023-10-25, o1bigtenor via Python-list wrote: > Haven't heard of a python IDE - - - doesn't mean that there isn't such - - > just that I haven't heard of such. Is there a python IDE? Seriously? Now you're just trolling. google.com/search?q=python+ide=python+ide -- Grant --

Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, o1bigtenor via Python-list wrote: > So how does one test software then? That's what customers are for! [Actually, that's true more often than it should be.] -- https://mail.python.org/mailman/listinfo/python-list

Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, Thomas Passin via Python-list wrote: > Something less ambitious than a full proof of correctness of an > arbitrary program can sometimes be achieved. The programming team > for the Apollo moon mission developed a system which, if you would > write your requirements in a certain

Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, Dan Purgert via Python-list wrote: > On 2023-10-24, o1bigtenor wrote: >> Greetings >> >> (Sorry for a nebulous subject but dunno how to have a short title for >> a complex question.) >> [...] >> Is there a way to verify that a program is going to do what it is >> supposed to do

Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, o1bigtenor via Python-list wrote: > Is there a way to verify that a program is going to do what it is > supposed to do even before all the hardware has been assembled and > installed and tested? It depends on what you mean by "verify ...". If you want to prove a program correct

Re: isinstance()

2023-08-04 Thread Grant Edwards via Python-list
On 2023-08-04, Chris Angelico via Python-list wrote: > On Sat, 5 Aug 2023 at 09:36, dn via Python-list > wrote: > >> Faced with a situation where an argument may be a scalar-value or an >> iterable, I'll presume the latter, eg throw it straight into a for-loop. >> If that fails (because the

Re: What is this TEST BANK stuff ?

2023-06-21 Thread Grant Edwards via Python-list
On 2023-06-21, Chris Angelico via Python-list wrote: > On Thu, 22 Jun 2023 at 02:54, Dan Kolis via Python-list > wrote: >> >> Why do we tolerate this spam ? >> >> this seems most likely a way to inject viruses into people's workflow. >> >> That wiped out usenet. Ahh without an explaination; ( and

Re: Resolution of paths in tracebacks

2023-05-31 Thread Grant Edwards
On 2023-05-31, Vishal Chandratreya wrote: > When an exception occurs, the full path to the file from which it > originates is displayed, but redundant elements are not removed. For > instance: > $ ./python ./foo > Traceback (most recent call last): > File "/home/User/cpython/./foo", line 4, in

Re: Tkinter docs?

2023-05-30 Thread Grant Edwards
On 2023-05-26, Rob Cliffe via Python-list wrote: > Grant, I may well buy one of the books you suggested. I haven't had look at either of the newer books, but I got a lot of good out of the Grayson book (20 years ago). I also had a Tcl/Tk book that I found useful even when usng tkinter, but

Re: Invalid literal for int() with base 10?

2023-05-26 Thread Grant Edwards
On 2023-05-26, Grant Edwards wrote: > On 2023-05-25, Kevin M. Wilson via Python-list wrote: > >> Ok, I'm not finding any info. on the int() for converting a str to >> an int (that specifies a base parameter)?! > > Where are you looking? > > https://docs.python.or

Re: Invalid literal for int() with base 10?

2023-05-25 Thread Grant Edwards
On 2023-05-25, Kevin M. Wilson via Python-list wrote: > Ok, I'm not finding any info. on the int() for converting a str to > an int (that specifies a base parameter)?! Where are you looking? https://docs.python.org/3/library/functions.html#int > The picture is of the code I've written...

Re: Tkinter docs?

2023-05-23 Thread Grant Edwards
On 2023-05-24, Rob Cliffe via Python-list wrote: > I have recently started converting a large project to tkinter, starting > with zero knowledge of tkinter.  (You are free to think: BAD IDEA. ) Well, you could be translating them to Tcl/Tk -- so on the scale of bad ideas, your's barely

Re: What to use instead of nntplib?

2023-05-22 Thread Grant Edwards
On 2023-05-22, Keith Thompson wrote: > My understanding is that nntplib isn't being erased from reality, > it's merely being removed from the set of modules that are provided > by default. > > I presume that once it's removed from the core, it will still be > possible to install it via pip or

Re: What to use instead of nntplib?

2023-05-22 Thread Grant Edwards
On 2023-05-21, Retrograde wrote: > Who ever came up with "Removing dead batteries" as a slogan, when > some of those batteries still work perfectly well, needs to rethink > it. Go ahead and remove code that no longer works, OK. But removing > unpopular modules? That undercuts the entire

Re: Tkinter (related)~

2023-05-18 Thread Grant Edwards
On 2023-05-19, Cameron Simpson wrote: > On 18May2023 12:06, Jack Dangler wrote: >>I thought the OP of the tkinter thread currently running may have >>needed to install the tkinter package (since I had the same missing >>component error message), so I tried to install the package on to my

Re: Learning tkinter

2023-05-18 Thread Grant Edwards
On 2023-05-12, Rob Cliffe via Python-list wrote: > > Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 > bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import tkinter > >>> tkinter.messagebox > Traceback (most recent

Re: What to use instead of nntplib?

2023-05-16 Thread Grant Edwards
On 2023-05-16, Chris Green wrote: > Grizzy Adams wrote: >> Tuesday, May 16, 2023 at 9:26, Alan Gauld wrote: >> Re: What to use instead of nntplib? (at least in part) >> >> >On 15/05/2023 22:11, Grant Edwards wrote: >> >> I got a nice warnin

Re: What to use instead of nntplib?

2023-05-16 Thread Grant Edwards
On 2023-05-16, Alan Gauld wrote: > On 16/05/2023 10:06, Cameron Simpson wrote: > >>> I'm curious as to why nntplib is deprecated? Surely there are still a >>> lot of nntp servers around, both inside and outside corporate firewalls? Anything not used to develop AI is going to be depricated. An AI

Re: What to use instead of nntplib?

2023-05-15 Thread Grant Edwards
On 2023-05-15, Skip Montanaro wrote: >> I got a nice warning today from the inews utility I use daily: >> >> DeprecationWarning: 'nntplib' is deprecated and slated for >> removal in Python 3.13 >> >> What should I use in place of nntplib? > > I'd recommend creating a PyPI project with the

What to use instead of nntplib?

2023-05-15 Thread Grant Edwards
I got a nice warning today from the inews utility I use daily: DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13 What should I use in place of nntplib? -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Is npyscreen still alive?

2023-04-24 Thread Grant Edwards
On 2023-04-24, Mats Wichmann wrote: > On 4/24/23 10:32, Grant Edwards wrote: > >> However... I just realized that Python's curses support is missing two >> huge chunks: both menu and form support are not there. I guess that >> explains why people feel the need to writ

Re: Python curses missing form library?

2023-04-24 Thread Grant Edwards
On 2023-04-24, Alan Gauld wrote: > On 24/04/2023 17:26, Grant Edwards wrote: >> Does the Python curses support in the standard library not include >> support for the curses form library? It seems to include support for >> the panel library, but I can't find any mention of th

Re: Is npyscreen still alive?

2023-04-24 Thread Grant Edwards
On 2023-04-24, Grant Edwards wrote: > The other big advantage of an ncurses program is that since curses > support is in the std library, a curses app is simpler to > distribute. Right now, the application is a single .py file you > just copy to the destination machine and run.

Python curses missing form library?

2023-04-24 Thread Grant Edwards
Does the Python curses support in the standard library not include support for the curses form library? It seems to include support for the panel library, but I can't find any mention of the form library. I see in the docs that menu support is still missing. :/ -- Grant --

Re: Is npyscreen still alive?

2023-04-24 Thread Grant Edwards
On 2023-04-24, Michael Torrie wrote: > On 4/21/23 15:57, Barry wrote: > >> Maybe this, recently lwn.net article, >> https://textual.textualize.io/ I was planning to check it out. > > Textual definitely looks slick and modern. And with a modern > terminal emulator it works quite well and is

Is npyscreen still alive?

2023-04-21 Thread Grant Edwards
I recently googled across the ncurses application framework npyscreen, and was thinking about giving it a try for a small but real project (something that would be distributed to customers), but I'm a bit concerned that npyscreen no longer "alive". The pypi page says the homepage is

Re: Weak Type Ability for Python

2023-04-13 Thread Grant Edwards
On 2023-04-13, Cameron Simpson wrote: > On 12Apr2023 22:12, avi.e.gr...@gmail.com wrote: > >>I suspect the OP is thinking of languages like PERL or JAVA which guess >>for you and make such conversions when it seems to make sense. > > JavaScript guesses. What a nightmare. So does PHP. What's

Re: Weak Type Ability for Python

2023-04-12 Thread Grant Edwards
On 2023-04-12, Ali Mohseni Roodbari wrote: > Hi all, > Please make this command for Python (if possible): > x=1 y='a' wprint (x+y) 1a If that's what you want, use PHP or some other language. Don't try to ruin Python. > In fact make a new type of print command which can

Re: Dataclasses, immutability(?), and ChatGPT

2023-04-12 Thread Grant Edwards
On 2023-04-12, Roel Schroeven wrote: >> Huh? If we'd been discussing namedtuples over (say) dictionaries, I'd >> perhaps have accepted the reply. > > ChatGPT is wrong. > >> Anything I've 'missed'? >> - or a salutary tale of not depending upon ChatGPT etc? > You didn't miss anything, ChatGPT is

Re: Windows Gui Frontend

2023-04-02 Thread Grant Edwards
On 2023-04-02, Michael Torrie wrote: > On 4/2/23 05:09, Dietmar Schwertberger wrote: >> I also did evaluate all the GUI builder from time to time between >> 2000 and 2016 to find one that I could recommend to colleagues, >> but could not find one. Then I started contributing to wxGlade >> and I

Re: Windows Gui Frontend

2023-04-01 Thread Grant Edwards
On 2023-04-01, Thomas Passin wrote: > Having worked with both, I'd rather use PyQt, although Tk might be > easier to get a toy app going with. Both editing windows and packing > are easier for me to understand with PyQt, for one thing. With tk it is _very_ easy to get small apps going. As

Re: built-in pow() vs. math.pow()

2023-03-30 Thread Grant Edwards
On 2023-03-30, Thomas Passin wrote: > On 3/30/2023 5:15 AM, Andreas Eisele wrote: >> [...] I was unpleasantly surprised that math.pow() does not have >> this feature, hence "from math import *" overwrites the built-in >> pow() function with a function that lacks functionality. [...] > > Not an

Re: What kind of "thread safe" are deque's actually?

2023-03-29 Thread Grant Edwards
On 2023-03-29, Jack Dangler wrote: > >> data = sorted(data) > > Sorry for any injected confusion here, but that line "data = > sorted(data)" appears as though it takes the value of the variable named > _data_, sorts it and returns it to the same variable store, so no copy > would be

Re: Standard class for time *period*?

2023-03-28 Thread Grant Edwards
On 2023-03-28, Thomas Passin wrote: > On 3/28/2023 12:13 PM, Grant Edwards wrote: >> On 2023-03-28, Dennis Lee Bieber wrote: >> >>> So far, you seem to be the only person who has ever asked for a >>> single entity incorporating an EPOCH (datetime.datetime) + a

Re: Standard class for time *period*?

2023-03-28 Thread Grant Edwards
On 2023-03-28, Dennis Lee Bieber wrote: > So far, you seem to be the only person who has ever asked for a > single entity incorporating an EPOCH (datetime.datetime) + a > DURATION (datetime.timedelta). It seems to me that tuple of two timdate objects (start,end) is the more obvious

Re: What kind of "thread safe" are deque's actually?

2023-03-27 Thread Grant Edwards
On 2023-03-28, Travis Griggs wrote: > A while ago I chose to use a deque that is shared between two threads. I did > so because the docs say: > > "Deques support thread-safe, memory efficient appends and pops from > either side of the deque with approximately the same O(1) > performance in

Re: Friday finking: IDE 'macro expansions'

2023-03-16 Thread Grant Edwards
On 2023-03-16, Thomas Passin wrote: > In general, I don't like a lot of popups and code completions, so I > tend to avoid them. I don't even like automatic parens or brace > insertion. I _hate_ it when the "editor" decides to insert stuff I didn't type. There's an html editor I use

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
On 2023-03-10, Cameron Simpson wrote: > On 10Mar2023 09:12, Grant Edwards wrote: >>On 2023-03-10, Weatherby,Gerard wrote: >>> On our Linux systems, I can up-arrow to go back to prior commands >>> and use the left and right arrows to navigate a line. The >&g

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
On 2023-03-10, Weatherby,Gerard wrote: > On our Linux systems, I can up-arrow to go back to prior commands > and use the left and right arrows to navigate a line. The > functionality may be provided internally by readline. I’ve never had > to dig into it because it meets my needs out of the box.

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
On 2023-03-10, Weatherby,Gerard wrote: > I would say, “No, readline is not the right tool.” > > cmd.Cmd is: https://docs.python.org/3/library/cmd.html. I have a > couple of cmd.Cmd modules, one of which I use daily and the other > weekly. I'll have to remember that one. It doesn't really fit my

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-10, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2023-03-10 at 12:57:48 +1100, > Chris Angelico wrote: > >> On Fri, 10 Mar 2023 at 12:56, Greg Ewing via Python-list >> wrote: >> > >> > On 10/03/2

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-10, Greg Ewing via Python-list wrote: > On 10/03/23 10:08 am, Grant Edwards wrote: >> It finally dawned on me after seeing an example I found elsewhere that >> you don't call some module method to fetch the next user-entered line. >> >> You call the inpu

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Chris Angelico wrote: > On Fri, 10 Mar 2023 at 10:04, Grant Edwards wrote: > >> Yeesh. What's _really_ embarassing is that I just stumbled across a >> small test program with which I had apparently figured this out >> 10-12 years ago. Must be about t

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Grant Edwards wrote: > On 2023-03-09, Cameron Simpson wrote: > >> [...] >>>It finally dawned on me after seeing an example I found elsewhere that >>>you don't call some module method to fetch the next user-entered line. >>> >>>

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Cameron Simpson wrote: > [...] >>It finally dawned on me after seeing an example I found elsewhere that >>you don't call some module method to fetch the next user-entered line. >> >>You call the input() built-in. > > Ah. That's not overtly stated? [...reads...] Ah, there it is in

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Chris Angelico wrote: > Not sure about the history file, and I would assume that if you don't > configure one, history is simply lost when you restart. But with tab > completion, unless you need to be able to input a tab character, it > should be safe to ignore the feature and

  1   2   3   4   5   6   7   8   9   10   >