Re: Best use of "open" context manager

2024-07-06 Thread Thomas Passin via Python-list
On 7/6/2024 6:49 AM, Rob Cliffe via Python-list wrote: Consider this scenario (which I ran into in real life):     I want to open a text file and do a lot of processing on the lines of that file.     If the file does not exist I want to take appropriate action, e.g. print an error message

Re: Difference method vs attribut = function

2024-06-29 Thread Thomas Passin via Python-list
On 6/28/2024 12:08 PM, Ulrich Goebel via Python-list wrote: Hi, a class can have methods, and it can have attributes, which can hold a function. Both is well known, of course. My question: Is there any difference? The code snipped shows that both do what they should do. But __dict__ includes

[RELEASE] Python 3.13.0 beta 3 released.

2024-06-27 Thread Thomas Wouters via Python-list
l#id9>. (Some removals present in alpha 1 were reverted in alpha 2, as the removals were deemed too disruptive at this time.) - New deprecations <https://docs.python.org/3.13/whatsnew/3.13.html#deprecated>, most of which are scheduled for removal from Python 3.15 or 3.16. (He

Re: Anonymous email users

2024-06-24 Thread Thomas Passin via Python-list
On 6/24/2024 5:51 AM, Barry Scott via Python-list wrote: On 23 Jun 2024, at 06:58, Sebastian Wells via Python-list wrote: The spammers won the spam wars, so even if you have someone's real e-mail address, that's no guarantee that you can contact them. You certainly wouldn't be able to

Re: win32clipboard writing to clipboard on Windows 11

2024-06-17 Thread Thomas Passin via Python-list
On 6/17/2024 9:30 PM, MRAB via Python-list wrote: On 2024-06-17 20:27, Rob Cliffe via Python-list wrote: Recently I acquired a new laptop running WIndows 11; my previous one uses WIndows 10.  I encountered a strange problem: I am using the win32clipboard backage (part of pywin32), and when I

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
On 6/8/2024 2:46 PM, avi.e.gr...@gmail.com wrote: Agreed, Thomas. As someone who has spent lots of time writing code OR requirements of various levels or having to deal with the bugs afterwards, there can be a huge disconnect between the people trying to decide what to do and the people

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

[RELEASE] Python 3.12.4 released

2024-06-06 Thread Thomas Wouters via Python-list
y volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation. Regards from still quite sunny Sunnyvale, Your release team, Thomas Wouters @thomas

[RELEASE] Python 3.13.0 beta 2 released.

2024-06-06 Thread Thomas Wouters via Python-list
New deprecations <https://docs.python.org/3.13/whatsnew/3.13.html#deprecated>, most of which are scheduled for removal from Python 3.15 or 3.16. (Hey, *fellow core developer,* if a feature you find important is missing from this list, let Thomas know .) For more details on the changes to P

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 g

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,

[RELEASE] Python 3.13.0 beta 1 released

2024-05-08 Thread Thomas Wouters via Python-list
.) - New deprecations <https://docs.python.org/3.13/whatsnew/3.13.html#deprecated>, most of which are scheduled for removal from Python 3.15 or 3.16. (Hey, *fellow core developer,* if a feature you find important is missing from this list, let Thomas know .) For more details on t

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,

[RELEASE] Python 3.12.3 and 3.13.0a6 released

2024-04-09 Thread Thomas Wouters via Python-list
whatsnew/3.13.html#id9>. (Some removals present in alpha 1 were reverted in alpha 2, as the removals were deemed too disruptive at this time.) (Hey, *fellow core developer,* if a feature you find important is missing from this list, let Thomas know . It’s getting to be really

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
the conditions are complex and many points of immediate return, fine, then it may be dangerous. But a single return is fine. The function does have a flaw as it is not clear what it should do if nothing is found. Calling a silly long name does not necessarily return anything. Others, like Thomas, have

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-22 Thread Thomas Schweikle via Python-list
ut of the box. Refer to their instructions how to install packages. -- Thomas OpenPGP_signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Thomas Nyberg via Python-list
iest approach is to just throw away threads entirely and learn how to do all I want fully in the brave new async world, but I'm still curious why this is failing and how to make this sort of setup work since it points to my not understanding the basic implementation/semantics of async in pyt

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

Using a background thread with asyncio/futures with flask

2024-03-20 Thread Thomas Nyberg via Python-list
=1.7.0 click==8.1.7 Flask==3.0.2 itsdangerous==2.1.2 Jinja2==3.1.3 MarkupSafe==2.1.5 Werkzeug==3.0.1 ``` Thanks for any help! Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

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']

[RELEASE] Python 3.13.0a5 is now available

2024-03-12 Thread Thomas Wouters via Python-list
l#id9>. (Some removals present in alpha 1 have been reverted in alpha 2, as the removals were deemed too disruptive at this time.) (Hey, *fellow core developer,* if a feature you find important is missing from this list, let Thomas know .) The next pre-release of Python 3.13 will be 3.13.0a6,

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

[RELEASE] Python 3.13.0a4 is now available

2024-02-15 Thread Thomas Wouters via Python-list
als were deemed too disruptive at this time.) (Hey, *fellow core developer,* if a feature you find important is missing from this list, let Thomas know .) The next pre-release of Python 3.13 will be 3.13.0a5, currently scheduled for 2023-03-12. <https://discuss.python.org/t/python-3-13-alpha-4/4

[RELEASE] Python 3.12.2 and 3.11.8 now available.

2024-02-07 Thread Thomas Wouters via Python-list
; or CPython itself <https://github.com/sponsors/python>. Thomas Wouters @thomas <https://discuss.python.org/u/thomas> on behalf of your release team, Ned Deily Steve Dower Pablo Galindo Salgado Łukasz Langa -- https://mail.python.org/mailman/listinfo/python-list

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
down the requirements as best you can figure them out, and then make sure that they are expressed such that the readers can understand. On 2/3/2024 11:33 AM, avi.e.gr...@gmail.com wrote: Thomas, I have been thinking about the concept of being stingy with information as this is a fairly common

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
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 originally asked for back on Jan 11. He's been too stingy with information since then to be worth spending much time on, IMHO. Some formats can be done

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

Python 3.13.0a3 is now available.

2024-01-17 Thread Thomas Wouters via Python-list
//docs.python.org/dev/whatsnew/3.13.html#id10> and deprecations <https://docs.python.org/dev/whatsnew/3.13.html#id9>. (Some removals present in alpha 1 have been reverted in alpha 2, as the removals were deemed too disruptive at this time.) (Hey, *fellow core developer,* if a feature yo

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: ")

[Python-announce] Python 3.12.1 is now available

2023-12-07 Thread Thomas Wouters
you-enjoy-the-new-releases-7>We hope you enjoy the new releases! Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation

Python 3.12.1 is now available

2023-12-07 Thread Thomas Wouters via Python-list
you-enjoy-the-new-releases-7>We hope you enjoy the new releases! Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation <https://www.python.org/psf-landing/>. Your release team, Thomas Wouters Ned Deily Steve Dower Łukasz Langa -- Thomas Wouters -- https://mail.python.org/mailman/listinfo/python-list

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

  1   2   3   4   5   6   7   8   9   10   >