Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Thomas Passin via Python-list
On 6/12/2024 1:59 PM, Chris Angelico via Python-list wrote: On Thu, 13 Jun 2024 at 03:41, AVI GROSS via Python-list wrote: Change is hard even when it may be necessary. The argument often is about whether some things are necessary or not. Python made a decision but clearly not a unanimous

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread Thomas Passin via Python-list
to do things in a specific way for a specific purpose ... -Original Message- From: Python-list On Behalf Of Thomas Passin via Python-list Sent: Saturday, June 8, 2024 1:10 PM To: python-list@python.org Subject: Re: From JoyceUlysses.txt -- words occurring exactly once On 6/8/2024 11:

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread Thomas Passin via Python-list
On 6/8/2024 11:54 AM, Larry Martell via Python-list wrote: On Sat, Jun 8, 2024 at 10:39 AM Mats Wichmann via Python-list < python-list@python.org> wrote: On 6/5/24 05:10, Thomas Passin via Python-list wrote: Of course, we see this lack of clarity all the time in questions to the li

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-06 Thread Thomas Passin via Python-list
On 6/5/2024 12:33 AM, dn via Python-list wrote: On 31/05/24 14:26, HenHanna via Python-list wrote: On 5/30/2024 2:18 PM, dn wrote: On 31/05/24 08:03, HenHanna via Python-list wrote: Given a text file of a novel (JoyceUlysses.txt) ... could someone give me a pretty fast (and simple) Python

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-01 Thread Thomas Passin via Python-list
On 6/1/2024 4:04 AM, Peter J. Holzer via Python-list wrote: On 2024-05-30 19:26:37 -0700, HenHanna via Python-list wrote: hard to decide what to do with hyphens and apostrophes (I'd, he's, can't, haven't, A's and B's) Especially since the same character is

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-31 Thread Thomas Passin via Python-list
On 5/30/2024 4:03 PM, HenHanna via Python-list wrote: Given a text file of a novel (JoyceUlysses.txt) ... could someone give me a pretty fast (and simple) Python program that'd give me a list of all words occurring exactly once?   -- Also, a list of words occurring once, twice

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
On 5/29/2024 10:59 AM, MRAB via Python-list wrote: On 2024-05-29 15:32, Thomas Passin via Python-list wrote: On 5/29/2024 8:55 AM, Kevin M. Wilson wrote: Please recall, I said the format for the email failed to retain the proper indents. I'll attach a picture of the code! Purpose

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
*Isaiah 43:2 * On Wednesday, May 29, 2024 at 06:19:56 AM MDT, Thomas Passin via Python-list wrote: On 5/29/2024 3:14 AM, Chris Angelico via Python-list wrote: > On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list > mailto:python-list@python.org>> wrote: >>

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
On 5/29/2024 3:14 AM, Chris Angelico via Python-list wrote: On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list wrote: By which Thomas means stuff like this: print(f'if block {name[index]} and index {index}') Notice the leading "f'". Personally I wouldn't even go that far,

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-28 Thread Thomas Passin via Python-list
Your code is unreadable. The lines have all run together. And after that, kindly explain what you want your code sample to do. "Process" doesn't say much. From what I can make out about what you are trying to do, you would do better to index through your string with for i, chr in

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

2024-05-27 Thread Thomas Passin via Python-list
On 5/26/2024 2:28 AM, 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 Thomas Passin via Python-list
On 5/19/2024 6:00 PM, Karsten Hilbert via Python-list wrote: Am Sun, May 19, 2024 at 10:45:09PM +0100 schrieb Barry via Python-list: 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

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

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 6:34 PM, Grant Edwards via Python-list wrote: 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.

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

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 6:08 PM, Skip Montanaro via Python-list wrote: Modern debian (ubuntu) and fedora block users installing using pip. Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I honestly haven't tried. Maybe I should... 樂 I have an old laptop

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

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 3:32 AM, Alan Gauld via Python-list wrote: On 18/05/2024 19:12, Piergiorgio Sartor via Python-list wrote: [snip] 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

Re: help

2024-05-13 Thread Thomas Passin via Python-list
On 5/12/2024 7:56 PM, Enrder via Python-list wrote: good tader I need help to install the bcml, and is that after installing the python and I go to the command prompt and put ''pip install bcml'' to install it tells me "pip" is not recognized as an internal or external command,

Re: how to discover what values produced an exception?

2024-05-03 Thread Thomas Passin via Python-list
On 5/3/2024 9:56 AM, Johanne Fairchild via Python-list wrote: How to discover what values produced an exception? Or perhaps---why doesn't the Python traceback show the values involved in the TypeError? For instance: --8<>8--- (0,0) < 4

Re: First two bytes of 'stdout' are lost

2024-04-11 Thread Thomas Passin via Python-list
On 4/11/2024 8:42 AM, Olivier B. via Python-list wrote: I am trying to use StringIO to capture stdout, in code that looks like this: import sys from io import StringIO old_stdout = sys.stdout sys.stdout = mystdout = StringIO() print( "patate") mystdout.seek(0) sys.stdout = old_stdout

Re: How to Add ANSI Color to User Response

2024-04-11 Thread Thomas Passin via Python-list
On 4/10/2024 6:41 PM, 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: ModuleNotFoundError: No module named 'Paramiko'

2024-04-08 Thread Thomas Passin via Python-list
On 4/8/2024 3:35 PM, Keith Thompson via Python-list wrote: Thomas Passin writes: On 4/8/2024 2:01 PM, Dietmar Schwertberger via Python-list wrote: To be sure, you can always go the the directory of the Python interpreter and open a cmd window there. (By entering 'cmd' into the explorer

Re: ModuleNotFoundError: No module named 'Paramiko'

2024-04-08 Thread Thomas Passin via Python-list
On 4/8/2024 2:01 PM, Dietmar Schwertberger via Python-list wrote: To be sure, you can always go the the directory of the Python interpreter and open a cmd window there. (By entering 'cmd' into the explorer address bar.) Then enter 'python.exe -mpip install paramiko'. This way you can be sure

Re: Running issues

2024-04-05 Thread Thomas Passin via Python-list
On 4/5/2024 5:32 PM, shannon makasale via Python-list wrote: Hi there, My name is Shannon. I installed Python 3.12 on my laptop a couple months ago, but realised my school requires me to use 3.11.1. I uninstalled 3.12 and installed 3.11.1. Unfortunately, I am unable to run python now. It

Re: A technique from a chatbot

2024-04-04 Thread Thomas Passin via Python-list
On 4/4/2024 3:03 PM, Mark Bourne via Python-list wrote: Thomas Passin wrote: On 4/2/2024 1:47 PM, Piergiorgio Sartor via Python-list wrote: On 02/04/2024 19.18, Stefan Ram wrote:    Some people can't believe it when I say that chatbots improve    my programming productivity. So, here's

Re: Help Needed With a Python Gaming Module

2024-04-03 Thread Thomas Passin via Python-list
On 4/3/2024 3:06 PM, WordWeaver Evangelist via Python-list wrote: Hello everyone! It has been a l-o-n-g time -- nine years in fact --since I last participated on this mailing list. [snip] 3. You are very familiar with the Jython 2 environment, which I am told is based on Python 2 and NOT

Re: A technique from a chatbot

2024-04-03 Thread Thomas Passin via Python-list
On 4/3/2024 1:27 AM, AVI GROSS via Python-list wrote: I am a tad confused by a suggestion that any kind of GOTO variant is bad. The suggestion runs counter to the reality that underneath it all, compiled programs are chock full of GOTO variants even for simple things like IF-ELSE. Consider

Re: A technique from a chatbot

2024-04-02 Thread Thomas Passin via Python-list
On 4/2/2024 1:47 PM, Piergiorgio Sartor via Python-list wrote: On 02/04/2024 19.18, Stefan Ram wrote:    Some people can't believe it when I say that chatbots improve    my programming productivity. So, here's a technique I learned    from a chatbot!    It is a structured "break". "Break" still

Re: the name ``wheel''

2024-03-21 Thread Thomas Passin via Python-list
On 3/21/2024 4:19 PM, Grant Edwards via Python-list wrote: 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

Re: Configuring an object via a dictionary

2024-03-16 Thread Thomas Passin via Python-list
On 3/16/2024 8:12 AM, Roel Schroeven via Python-list wrote: Barry via Python-list schreef op 16/03/2024 om 9:15: > On 15 Mar 2024, at 19:51, Thomas Passin via Python-list   wrote: > > I've always like writing using the "or" form and have never gotten bit I, on the oth

Re: Configuring an object via a dictionary

2024-03-15 Thread Thomas Passin via Python-list
On 3/15/2024 5:33 PM, Dan Sommers via Python-list wrote: On 2024-03-15 at 15:48:17 -0400, Thomas Passin via Python-list wrote: [...] And I suppose there is always the possibility that sometime in the future an "or" clause like that will be changed to return a Boolean, which one wo

Re: Configuring an object via a dictionary

2024-03-15 Thread Thomas Passin via Python-list
On 3/15/2024 3:09 PM, Grant Edwards via Python-list wrote: 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

Re: Configuring an object via a dictionary

2024-03-15 Thread Thomas Passin via Python-list
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 = config['source_name'] self.server_host = config['server_host']

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

2024-03-10 Thread Thomas Passin via Python-list
On 3/10/2024 9:33 AM, Albert-Jan Roskam wrote: On Mar 10, 2024 12:59, Thomas Passin via Python-list wrote: On 3/10/2024 6:17 AM, Barry wrote: > > >> On 8 Mar 2024, at 23:19, Thomas Passin via Python-list wrote: >> >> We just

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

2024-03-10 Thread Thomas Passin via Python-list
On 3/10/2024 6:17 AM, Barry wrote: On 8 Mar 2024, at 23:19, Thomas Passin via Python-list wrote: We just learned a few posts back that it might be specific to Linux; I ran it on Windows. Depending on the exact win32 api used there is a 257 limit on windows. The 257 includes 2

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

2024-03-08 Thread Thomas Passin via Python-list
On 3/8/2024 5:14 PM, Albert-Jan Roskam wrote: On Mar 8, 2024 19:35, 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 Thomas Passin via Python-list
On 3/8/2024 2:21 PM, 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: Path(256 * "x"

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

2024-03-08 Thread Thomas Passin via Python-list
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 Is this intended? Does pathlib try to resemble os.path as closely as

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

2024-03-06 Thread Thomas Passin via Python-list
On 3/6/2024 7:55 AM, Jacob Kruger via Python-list wrote: Ok, simpler version - all the code in a simpler test file, and working with two separate variables to explain exactly what am talking about: # start code from datetime import datetime, timezone, timedelta from copy import copy #

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

2024-03-06 Thread Thomas Passin via Python-list
On 3/6/2024 5:59 AM, Alan Gauld via Python-list wrote: On 05/03/2024 22:46, Grant Edwards via Python-list wrote: Unfortunately (presumably thanks to SEO) the enshittification of Google has reached the point where searching for info on things like Python name scope, the first page of links are

Re: Problem resizing a window and button placement

2024-02-26 Thread Thomas Passin via Python-list
On 2/26/2024 6:02 AM, Steve GS via Python-list wrote: Although your code produces the value of Ww outside the function, I do not see how I can use the value of Ww unless I close the program. The configuration event hasn't fired at the time you include the print statement in the handler's def

Re: Problem resizing a window and button placement

2024-02-25 Thread Thomas Passin via Python-list
On 2/25/2024 4:19 PM, Steve GS via Python-list wrote: SOLUTION FOUND! The fix was to write the code that uses the width value and to place it into the function itself. Kluge? Maybe but it works. Right, just what I wrote earlier: "have the function that responds to the resize event perform

Re: Problem resizing a window and button placement

2024-02-24 Thread Thomas Passin via Python-list
On 2/24/2024 9:51 PM, Steve GS via Python-list wrote: First of all, please make sure that the formatting is readable and especially the indentation. This is Python, after all. Do not use tabs; use 3 or 4 spaces instead of each tab. import tkinter as tk #global Ww Neither global helps def

Re: Problem resizing a window and button placement

2024-02-24 Thread Thomas Passin via Python-list
On 2/24/2024 3:20 AM, Steve GS via Python-list wrote: Yes, I ran that elegantly simple code. The print statement reports the X, Y, Height and Width values. However, I do not see how to capture the width value. I experimented with the code Vwidth = rootV.winfo_width() and it also reports the

Re: Testing (sorry)

2024-02-19 Thread Thomas Passin via Python-list
On 2/19/2024 11:55 AM, Skip Montanaro wrote: Here is a typical bounce message that I get: mailto:python-list@python.org>>: host mail.python.org [188.166.95.178] said: 450-4.3.2      Service currently unavailable 450 4.3.2 Some time after I get

Re: Testing (sorry)

2024-02-19 Thread Thomas Passin via Python-list
On 2/19/2024 9:17 AM, Grant Edwards via Python-list wrote: 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

Re: Testing (sorry)

2024-02-18 Thread Thomas Passin via Python-list
On 2/18/2024 6:09 PM, Grant Edwards via Python-list wrote: 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

Re: Extract lines from file, add to new files

2024-02-03 Thread Thomas Passin via Python-list
On 2/3/2024 5:02 PM, dn via Python-list wrote: Every trainer, in any field, has to deal with these problems - all the time, and over-and-over. On 4/02/24 06:58, Thomas Passin via Python-list wrote: In my view this whole thread became murky and complicated because the OP did not write down

Re: Extract lines from file, add to new files

2024-02-03 Thread Thomas Passin via Python-list
Of Thomas Passin via Python-list Sent: Wednesday, January 31, 2024 7:25 AM To: python-list@python.org Subject: Re: Extract lines from file, add to new files On 1/30/2024 11:25 PM, avi.e.gr...@gmail.com wrote: Thomas, on some points we may see it differently. I'm mostly going by what the OP

Re: Extract lines from file, add to new files

2024-01-31 Thread Thomas Passin via Python-list
On 1/31/2024 9:05 AM, Rich Shepard via Python-list wrote: On Tue, 30 Jan 2024, Thomas Passin via Python-list wrote: If I had a script that's been working for 30 years, I'd probably just use Python to do the personalizing and let the rest of the bash script do the rest, like it always has

Re: Extract lines from file, add to new files

2024-01-31 Thread Thomas Passin via Python-list
be heavily used, sure, you could tweak and optimize. As it is, Rich is getting a chance to improve his python skills no matter which way he goes. -Original Message- From: Python-list On Behalf Of Thomas Passin via Python-list Sent: Tuesday, January 30, 2024 10:37 PM To: python-list@python.org

Re: Extract lines from file, add to new files

2024-01-30 Thread Thomas Passin via Python-list
On 1/30/2024 12:21 PM, Rich Shepard via Python-list wrote: On Tue, 30 Jan 2024, Thomas Passin via Python-list wrote: Fine, my toy example will still be applicable. But, you know, you haven't told us enough to give you help. Do you want to replace text from values in a file? That's been covered

Re: Extract lines from file, add to new files

2024-01-30 Thread Thomas Passin via Python-list
On 1/30/2024 8:37 AM, Rich Shepard via Python-list wrote: On Mon, 29 Jan 2024, Thomas Passin via Python-list wrote: If you aren't going to use one or another existing template system, perhaps the easiest is to use unique strings in the message file. For example: Dear __##so-and-so

Re: Extract lines from file, add to new files

2024-01-29 Thread Thomas Passin via Python-list
On 1/29/2024 11:15 AM, Rich Shepard via Python-list wrote: For my use 1) the salutation and email address (always with an '@') are sequential and 2) I'm developing the script to extract both from the same file. I've looked at my Python books "Python Crash Course," "Effective Python," and

Re: How to replace a cell value with each of its contour cells and yield the corresponding datasets seperately in a list according to a Pandas-way?

2024-01-21 Thread Thomas Passin via Python-list
. Someone else will probably pitch in. Thanks. Le dim. 21 janv. 2024 à 18:28, Thomas Passin via Python-list mailto:python-list@python.org>> a écrit : On 1/21/2024 11:54 AM, marc nicole wrote: > Thanks for the reply, > > I think using a Pandas (or a Numpy)

Re: How to replace a cell value with each of its contour cells and yield the corresponding datasets seperately in a list according to a Pandas-way?

2024-01-21 Thread Thomas Passin via Python-list
t_contours(target_cells)     print(contour_cells)     target_cells_with_contour = apply_contours(target_cells, contour_cells)     datasets = create_possible_datasets(zipf_dataset, target_cells_with_contour)     print(datasets) main() Le dim. 21 janv. 2024 à 16:33, Thomas Passin via Python-list mai

Re: How to replace a cell value with each of its contour cells and yield the corresponding datasets seperately in a list according to a Pandas-way?

2024-01-21 Thread Thomas Passin via Python-list
On 1/21/2024 7:37 AM, marc nicole via Python-list wrote: Hello, I have an initial dataframe with a random list of target cells (each cell being identified with a couple (x,y)). I want to yield four different dataframes each containing the value of one of the contour (surrounding) cells of each

Re: Question about garbage collection

2024-01-16 Thread Thomas Passin via Python-list
On 1/16/2024 4:17 AM, Barry wrote: On 16 Jan 2024, at 03:49, Thomas Passin via Python-list wrote: This kind of thing can happen with PyQt, also. There are ways to minimize it but I don't know if you can ever be sure all Qt C++ objects will get deleted. It depends on the type of object

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-15 Thread Thomas Passin via Python-list
On 1/15/2024 7:24 PM, Thomas Passin wrote: On 1/15/2024 6:27 PM, Greg Ewing via Python-list wrote: On 16/01/24 11:55 am, Mats Wichmann wrote: Windows natively has something called python.exe and python3.exe which is interfering here I'm wondering whether py.exe should be taught to recognise

Re: Question about garbage collection

2024-01-15 Thread Thomas Passin via Python-list
On 1/15/2024 9:47 PM, Akkana Peck via Python-list wrote: I wrote: Also be warned that some modules (particularly if they're based on libraries not written in Python) might not garbage collect, so you may need to use other methods of cleaning up after those objects. Chris Angelico writes:

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-15 Thread Thomas Passin via Python-list
On 1/15/2024 6:27 PM, Greg Ewing via Python-list wrote: On 16/01/24 11:55 am, Mats Wichmann wrote: Windows natively has something called python.exe and python3.exe which is interfering here I'm wondering whether py.exe should be taught to recognise these stubs and ignore them. This sounds

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-15 Thread Thomas Passin via Python-list
On 1/15/2024 1:26 PM, Mats Wichmann via Python-list wrote: On 1/15/24 09:44, Sibylle Koczian via Python-list wrote: First and foremost I want to understand why I'm seeing this: - Python scripts with "/usr/bin/env python3" as shebang line work as expected on a computer with Windows 10 and

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-14 Thread Thomas Passin via Python-list
On 1/14/2024 8:54 AM, Thomas Passin via Python-list wrote: On 1/14/2024 7:48 AM, Sibylle Koczian via Python-list wrote: Am 09.01.2024 um 12:36 schrieb Barry Scott via Python-list: On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list wrote: Oh, and the two Windows and Python versions

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-14 Thread Thomas Passin via Python-list
On 1/14/2024 7:48 AM, Sibylle Koczian via Python-list wrote: Am 09.01.2024 um 12:36 schrieb Barry Scott via Python-list: On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list wrote: Oh, and the two Windows and Python versions are on two different computers. Will remove the "/env"

Re: Extract lines from file, add to new files

2024-01-11 Thread Thomas Passin via Python-list
On 1/11/2024 1:27 PM, MRAB via Python-list wrote: On 2024-01-11 18:08, Rich Shepard via Python-list wrote: It's been several years since I've needed to write a python script so I'm asking for advice to get me started with a brief script to separate names and email addresses in one file into two

Re: Using my routines as functions AND methods

2024-01-04 Thread Thomas Passin via Python-list
On 1/3/2024 8:00 PM, Alan Gauld via Python-list wrote: On 03/01/2024 22:47, Guenther Sohler via Python-list wrote: Hi, In my cpython i have written quite some functions to modify "objects". and their python syntax is e.g.\ translate(obj, vec). e.g whereas obj is ALWAYS first argument.

Re: Using my routines as functions AND methods

2024-01-03 Thread Thomas Passin via Python-list
On 1/3/2024 11:17 PM, Thomas Passin wrote: On 1/3/2024 8:00 PM, Alan Gauld via Python-list wrote: On 03/01/2024 22:47, Guenther Sohler via Python-list wrote: Hi, In my cpython i have written quite some functions to modify "objects". and their python syntax is e.g.\ translate(obj,

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-02 Thread Thomas Passin via Python-list
On 1/2/2024 11:56 AM, Mats Wichmann via Python-list wrote: On 1/1/24 12:53, Thomas Passin via Python-list wrote: On Windows 10, a shebang line gets ignored in favor of Python 3.9.9 (if invoked by the script name alone) or Python 3.12.1 (if invoked by the "py" launcher). fwiw, yo

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-01 Thread Thomas Passin via Python-list
On 1/1/2024 12:26 PM, Mats Wichmann via Python-list wrote: On 1/1/24 07:11, Thomas Passin via Python-list wrote: Here's how to find out what program Windows thinks it should use to run a ".py" file.  In a console: C:\Users\tom>assoc .py .py=Python.File C:\Users\tom>f

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-01 Thread Thomas Passin via Python-list
On 1/1/2024 8:19 AM, Thomas Passin via Python-list wrote: On 1/1/2024 6:02 AM, Sibylle Koczian via Python-list wrote: Am 30.12.2023 um 04:04 schrieb Mike Dewhirst via Python-list: I had assumed the OP had installed Python from the Microsoft shop and that's where py.exe must have come from

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-01 Thread Thomas Passin via Python-list
On 1/1/2024 6:02 AM, Sibylle Koczian via Python-list wrote: Am 30.12.2023 um 04:04 schrieb Mike Dewhirst via Python-list: I had assumed the OP had installed Python from the Microsoft shop and that's where py.exe must have come from. In fact I didn't say in my post that I always get Python

Re: mypy question

2023-12-30 Thread Thomas Passin via Python-list
On 12/30/2023 9:14 AM, Thomas Passin via Python-list wrote: On 12/29/2023 10:02 AM, Karsten Hilbert via Python-list wrote: I agree that mypy's grasp of my intent from queries:list[dict[str, str | list | dict[str, Any]]]=None, into "List[Dict[str, Union[str, List[Any], Dict[str

Re: mypy question

2023-12-30 Thread Thomas Passin via Python-list
On 12/29/2023 10:02 AM, Karsten Hilbert via Python-list wrote: Am Fri, Dec 29, 2023 at 07:49:17AM -0700 schrieb Mats Wichmann via Python-list: I am not sure why mypy thinks this gmPG2.py:554: error: Argument "queries" to "run_rw_queries" has incompatible type "List[Dict[str, str]]"; expected

Re: Aw: Re: mypy question

2023-12-30 Thread Thomas Passin via Python-list
On 12/30/2023 10:08 AM, Karsten Hilbert via Python-list wrote: Dear Thomas, thanks for taking the time to look into my issue. Maybe it helps if I explain what I want (sorry that my web mailer does not respect indentation, I will insert dots). I want a function to run SQL queries:

Re: Aw: Re: mypy question

2023-12-30 Thread Thomas Passin via Python-list
On 12/30/2023 10:08 AM, Karsten Hilbert via Python-list wrote: Dear Thomas, thanks for taking the time to look into my issue. Maybe it helps if I explain what I want (sorry that my web mailer does not respect indentation, I will insert dots). I want a function to run SQL queries:

Re: mypy question

2023-12-30 Thread Thomas Passin via Python-list
On 12/29/2023 10:02 AM, Karsten Hilbert via Python-list wrote: I agree that mypy's grasp of my intent from queries:list[dict[str, str | list | dict[str, Any]]]=None, into "List[Dict[str, Union[str, List[Any], Dict[str, Any" seems accurate. I just don't understand why

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Thomas Passin via Python-list
On 12/22/2023 7:27 PM, Michael Torrie via Python-list wrote: On 12/22/23 07:02, Thomas Passin via Python-list wrote: On my Windows 10 machine, Python scripts run without a shebang line. Perhaps Windows 11 has added the ability to use one, but then you would need to use the actual location

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Thomas Passin via Python-list
On 12/22/2023 7:19 PM, Barry wrote: On 23 Dec 2023, at 00:15, Thomas Passin via Python-list wrote: In neither case is the shebang line used. As i understand it, not in front of my windows box to check. The handler for .py file extension is set to be the py.exe It is py.exe

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Thomas Passin via Python-list
On 12/22/2023 9:29 AM, Sibylle Koczian via Python-list wrote: Am 22.12.2023 um 14:13 schrieb Barry: On 22 Dec 2023, at 12:39, Sibylle Koczian via Python-list wrote: Hello, I always install Python on Windows in the same manner: - Python is not on the path, - it is installed for all

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-22 Thread Thomas Passin via Python-list
On 12/22/2023 7:36 AM, Sibylle Koczian via Python-list wrote: Hello, I always install Python on Windows in the same manner: - Python is not on the path, - it is installed for all users, - the Python Launcher is installed for all users, - the file types .py, .pyw etc. are associated with

Re: Type hints - am I doing it right?

2023-12-13 Thread Thomas Passin via Python-list
On 12/13/2023 11:17 AM, Mats Wichmann via Python-list wrote: On 12/13/23 00:19, Frank Millman via Python-list wrote: I have to add 'import configparser' at the top of each of these modules in order to type hint the method. This seems verbose. If it is the correct way of doing it I can live

Re: IDLE editor suggestion.

2023-12-12 Thread Thomas Passin via Python-list
On 2023-12-12 08:22, Steve GS via Python-list wrote: > Maybe this already exists but > I have never seen it in any > editor that I have used. > > It would be nice to have a > pull-down text box that lists > all of the searches I have > used during this session. It > would make editing a lot >

Re: A problem with str VS int.

2023-12-09 Thread Thomas Passin via Python-list
On 12/9/2023 9:42 PM, Steve GS via Python-list wrote: If I enter a one-digit input or a three-digit number, the code works but if I enter a two digit number, the if statement fails and the else condition prevails. tsReading = input(" Enter the " + Brand + " test strip reading: ")

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

2023-12-06 Thread Thomas Passin via Python-list
On 12/6/2023 1:12 PM, MRAB via Python-list wrote: On 2023-12-06 12:23, Thomas Passin via Python-list wrote: On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote: On 6 Dec 2023, at 09:32, Chris Green via Python-list wrote: My requirement is *slightly* more complex than just key value

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

2023-12-06 Thread Thomas Passin via Python-list
On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote: On 6 Dec 2023, at 09:32, Chris Green via Python-list wrote: My requirement is *slightly* more complex than just key value pairs, it has one level of hierarchy, e.g.:- KEY1: a: v1 c: v3 d: v4 KEY2: a:

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

2023-12-05 Thread Thomas Passin via Python-list
On 12/5/2023 11:50 AM, MRAB via Python-list wrote: On 2023-12-05 14:37, Chris Green via Python-list wrote: Is there a neat, pythonic way to store values which are 'sometimes' changed? My particular case at the moment is calibration values for ADC inputs which are set by running a calibration

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Thomas Passin via Python-list
On 11/24/2023 4:49 PM, Rimu Atkinson via Python-list wrote: I really can't think of a case where the missing comma would make any sense at all. That is pretty tricky, yes. The comma means it's a tuple. Without the comma, it's just a string with parenthesis around it, which is a

Re: Code improvement question

2023-11-17 Thread Thomas Passin via Python-list
On 11/17/2023 9:46 AM, Peter J. Holzer via Python-list wrote: On 2023-11-17 07:48:41 -0500, Thomas Passin via Python-list wrote: On 11/17/2023 6:17 AM, Peter J. Holzer via Python-list wrote: Oh, and Python (just like Perl) allows you to embed whitespace and comments into Regexps, which helps

Re: Code improvement question

2023-11-17 Thread Thomas Passin via Python-list
On 11/17/2023 6:17 AM, Peter J. Holzer via Python-list wrote: On 2023-11-16 11:34:16 +1300, Rimu Atkinson via Python-list wrote: Why don't you use re.findall? re.findall(r'\b[0-9]{2,7}-[0-9]{2}-[0-9]{2}\b', txt) I think I can see what you did there but it won't make sense to me - or whoever

Re: Newline (NuBe Question)

2023-11-16 Thread Thomas Passin via Python-list
On 11/16/2023 1:19 AM, Grizzy Adams via Python-list wrote: Wednesday, November 15, 2023 at 15:54, Thomas Passin via Python-list wrote: Re: Newline (NuBe Question) (at least in part) On 11/15/2023 2:04 PM, Grizzy Adams via Python-list wrote: Wednesday, November 15, 2023 at 12:19, Pierre

Re: Newline (NuBe Question)

2023-11-15 Thread Thomas Passin via Python-list
On 11/15/2023 2:04 PM, Grizzy Adams via Python-list wrote: Wednesday, November 15, 2023 at 12:19, Pierre Fortin wrote: Re: Newline (NuBe Question) (at least in part) On Wed, 15 Nov 2023 16:51:09 - Grizzy Adams via Python-list wrote: I don't give solutions; just a nudge... you appear not

Re: Newline (NuBe Question)

2023-11-15 Thread Thomas Passin via Python-list
On 11/15/2023 2:25 AM, Grizzy Adams via Python-list wrote: Hi & thanks for patience with what could be simple to you Have this (from an online "classes" tutorial) --- Start Code Snippit --- students = [] grades = [] for s in geographyClass: students.append(geographyStudent(s)) for s

Re: xor operator (DEPRECATED)

2023-11-13 Thread Thomas Passin via Python-list
On 11/13/2023 11:44 PM, AVI GROSS via Python-list wrote: Dom, I hear you. As you say, writing your own extension in something like C++ may not appeal to you even if it is faster. I was wondering if using a generator or something similar in R might make sense. I mean what happens if you

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread Thomas Passin via Python-list
. A simplified example: >>> S1 = 'string 1' >>> S2 = 'string 2' >>> (fS1, fS2) = list(range(2)) >>> fS1 0 >>> >>> fS2 1 On Nov 7, 2023, at 1:06 PM, Thomas Passin via Python-list wrote: On 11/7/2023 12:47 PM, Egon Frerich via Python-

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread Thomas Passin via Python-list
On 11/7/2023 12:47 PM, Egon Frerich via Python-list wrote: I've no idea why this happens. In a module there are lists and definitions:     Felder = [     # Name   lg1  lg2 typ   Ausrichtung Holen Prüfen Prüfvorg     ["Jahr", 4, 5, "u", "", "right", "center"],     ["Monat",

Re: Writing to clipboard in Python 3.11

2023-11-07 Thread Thomas Passin via Python-list
On 11/5/2023 7:51 PM, Rob Cliffe via Python-list wrote: Recently I switched from Python 3.8.3 to Python 3.11.4.  A strange problem appeared which was not there before: I am using the win32clipboard backage (part of pywin32), and when I use SetClipboardData() to write text which consists

Re: Detect naming typos (AttributeError) in function names

2023-11-07 Thread Thomas Passin via Python-list
On 11/7/2023 2:48 AM, Christian Buhtz via Python-list wrote: Hello Dieter, thanks for your reply. Am 06.11.2023 19:11 schrieb Dieter Maurer: One option is a test suite (--> Python's "unittest" package) with a sufficiently high coverage (near 100 %). Yes, that is the primary goal. But it is

Re: pip/pip3 confusion and keeping up to date

2023-11-06 Thread Thomas Passin via Python-list
On 11/6/2023 5:04 PM, Karsten Hilbert via Python-list wrote: Am Mon, Nov 06, 2023 at 02:43:47PM -0700 schrieb Mats Wichmann via Python-list: I had just hoped someone here might have a handy pointer for how to deal with modules having to be installed from pip for use with an apt-installed

Re: Checking if email is valid

2023-11-03 Thread Thomas Passin via Python-list
On 11/3/2023 6:51 AM, Jon Ribbens via Python-list wrote: On 2023-11-03, Chris Angelico wrote: On Fri, 3 Nov 2023 at 12:21, AVI GROSS via Python-list wrote: My guess is that a first test of an email address might be to see if a decent module of that kind fills out the object to your

Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list
is insisting on being instructed how to drive a race car in a race when he's only got a learner's permit. You just have to go through the experience of actually driving on streets and in traffic first. There is no substitute. TomP -Original Message- From: Python-list On Behalf Of Thomas

Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list
On 10/26/2023 6:36 PM, AVI GROSS via Python-list wrote: I am not one for IDLE worship, Tenor. But if you have been getting a message here, it is that there are an amazing number of programs that support your use of python during the development phase and perhaps later. I actually often use an

Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list
On 10/26/2023 4:25 PM, o1bigtenor via Python-list wrote: On Thu, Oct 26, 2023 at 11:43 AM Michael Torrie via Python-list wrote: On 10/26/23 06:34, o1bigtenor wrote: Interesting - - - - ". . . see if it runs." - - - that's the issue! When the code is accessing sensors there isn't an easy way

  1   2   3   4   5   >