Re: Extract lines from file, add to new files

2024-01-14 Thread dn via Python-list
OK, here are the conceptual differences between what Python grammar language does and what you'd expect from anything that's based on BNF, modified or not: Python isn't a context-free language, so the grammar that is used to describe it doesn't actually describe the language... so, it's a "

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

2024-01-14 Thread Mike Dewhirst via Python-list
did read that PEP but it has no relevance for my mixed Windows/Linux environments. On reflection I now believe I won't use py.exe because it introduces an unnecessary layer of indirection.The  bottom line is that you still need to know which Python a particular set of circumstances demands

RE: Extract lines from file, add to new files

2024-01-14 Thread AVI GROSS via Python-list
Whoa, Олег Сивоконь! I do not understand any arguments about whether comments are, or are not an object. From one perspective, python comments have even less meaning than whitespace and simply do not exist. I mean once a naked "#" is seen, the rest of that line is effectively

Re: Extract lines from file, add to new files

2024-01-14 Thread Chris Angelico via Python-list
On Mon, 15 Jan 2024 at 09:40, dn via Python-list wrote: > The basic challenge came from my earlier (and blasé) repetition of the > Python refrain "everything in Python is an object". Which led to: > > <<< > For example, you may say "functions in Py

RE: Extract lines from file, add to new files

2024-01-14 Thread AVI GROSS via Python-list
nd just let you pop up a variable as in "x=5" both declares and instantiates a variable. Strictly speaking, in a language like python, everything is an object and some of the way of creating them remains bound to other ideas like declaring a class uses key words as does declaring

Re: Extract lines from file, add to new files

2024-01-14 Thread dn via Python-list
On 15/01/24 10:23, Chris Angelico via Python-list wrote: On Mon, 15 Jan 2024 at 08:15, Left Right wrote: Python grammar rules prevent function definition from appearing in left-hand side of the head of the for loop. However, a variable declaration, which is also a statement, is allowed

Re: Extract lines from file, add to new files

2024-01-14 Thread Left Right via Python-list
nt function definition to be an assignment target. I was giving an example of how Python grammar works, how the rules govern what can or cannot be used in a particular place... In other words, if you aren't sure you understand the question, why are you trying to reply to it? Is your goal to learn the meaning of

Re: Extract lines from file, add to new files

2024-01-14 Thread Left Right via Python-list
al differences between what Python grammar language does and what you'd expect from anything that's based on BNF, modified or not: Python isn't a context-free language, so the grammar that is used to describe it doesn't actually describe the language... so, it's a "pretend grammar"

Re: Extract lines from file, add to new files

2024-01-14 Thread dn via Python-list
On 14/01/24 16:48, Chris Angelico wrote: On Sun, 14 Jan 2024 at 14:43, dn via Python-list wrote: Similarly, whilst we could write: a, b, c = 1, 2, 3 I would only do this when it aligns particularly well with the algorithm being implemented. For example, you could start a Fibonacci

Re: Extract lines from file, add to new files

2024-01-14 Thread Left Right via Python-list
> What do you mean? > > for x in lambda: ...: > ... > > Perfectly grammatical. 1. You put the lambda definition in the wrong place (it should be in the left-hand side, or as Python calls it "star_targets", but you put it into "star_expressions", which would

Re: Extract lines from file, add to new files

2024-01-14 Thread Left Right via Python-list
ation, but Prolog doesn't have function application in the same sense Python has, so it's still OK. In general, in languages that aren't like Prolog, conceptually, it's possible to either *define* variables (with optional initialization) or to *reuse* them (in the context of assignment that

Re: Extract lines from file, add to new files

2024-01-14 Thread Chris Angelico via Python-list
On Mon, 15 Jan 2024 at 08:15, Left Right wrote: > Python grammar rules prevent function definition from > appearing in left-hand side of the head of the for loop. However, a > variable declaration, which is also a statement, is allowed there. What is a "variable declaration"

RE: Extract lines from file, add to new files

2024-01-14 Thread AVI GROSS via Python-list
will be the one where a method is finally called using some diamond algorithm. It is both extremely powerful but also silly to overuse such features. Avi -Original Message- From: Python-list On Behalf Of Chris Angelico via Python-list Sent: Sunday, January 14, 2024 8:34 AM To: python-list

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: Extract lines from file, add to new files

2024-01-14 Thread AVI GROSS via Python-list
It can be worth considering why a language is designed or altered in certain ways to see if there was a tradeoff that made it seem worthwhile or easier than some other choice. Python grew and there was regular pressure to add keywords which might break existing programs. So, yes, sometimes

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 "

Re: Extract lines from file, add to new files

2024-01-14 Thread Chris Angelico via Python-list
On Mon, 15 Jan 2024 at 00:27, Left Right wrote: > > > What do you mean? > > > > for x in lambda: ...: > > ... > > > > Perfectly grammatical. > > 1. You put the lambda definition in the wrong place (it should be in > the left-hand side, o

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

2024-01-14 Thread Sibylle Koczian via Python-list
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" from my shebang lines, even if I don't underst

Re: Extract lines from file, add to new files

2024-01-14 Thread Chris Angelico via Python-list
On Sun, 14 Jan 2024 at 23:28, Left Right wrote: > Having worked with a bunch of different grammar languages, the one > used for Python isn't a recognizable BNF derivative. That might possibly be because it isn't? It's not BNF. It's PEG. Or are you a long way behind the times? > For exa

Re: Extract lines from file, add to new files

2024-01-13 Thread Chris Angelico via Python-list
On Sun, 14 Jan 2024 at 14:43, dn via Python-list wrote: > Similarly, whilst we could write: > > a, b, c = 1, 2, 3 > I would only do this when it aligns particularly well with the algorithm being implemented. For example, you could start a Fibonacci evaluator with "a, b =

Re: Extract lines from file, add to new files

2024-01-13 Thread dn via Python-list
On 13/01/24 00:11, Left Right via Python-list wrote: To people discussing BNF: The grammar language Python uses is *very* far from BNF. It's more similar to PEG, but even then it's still quite far. Python's grammar is just its own thing, which makes it harder to read, if you are already

Mtg: Object-Oriented VacExcHndlrs (UTC+13)

2024-01-13 Thread dn via Python-list
dlers" series (https://danceswithmice.info/Python/2024/VacExcHndlrs.html) - virtual-gatherings for folk left-behind to keep the wheels turning, whilst everyone else swans-off sunning themselves... (non-Kiwis please remember: it's not just school vacation, but summer-time down-under. Wish you

Re: Extract lines from file, add to new files

2024-01-13 Thread dn via Python-list
On 12/01/24 08:53, Rich Shepard via Python-list wrote: On Thu, 11 Jan 2024, Piergiorgio Sartor via Python-list wrote: Why not to use bash script for all? Piergiorgio, That's certainly a possibility, and may well be better than python for this task. (sitting in a meeting with little

Re: mypy question

2024-01-13 Thread Karsten Hilbert via Python-list
Am Sat, Jan 13, 2024 at 09:20:00PM +0100 schrieb Karsten Hilbert via Python-list: > > I was wondering if > > your type hint for queries shouldn't be the following. > > > > queries:list[dict[str,str]|dict[str,list]|dict[str,dict[str, dict[str, > > Ant]]] Wait, not

Re: mypy question

2024-01-13 Thread Karsten Hilbert via Python-list
Am Fri, Jan 12, 2024 at 02:23:43PM +0100 schrieb Antoon Pardon via Python-list: > > queries:list[dict[str, str | list | dict[str, Any]]]=None, > > > >into > > > > "List[Dict[str, Union[str, List[Any], Dict[str, Any" > > > >seems

Re: Extract lines from file, add to new files

2024-01-13 Thread Greg Ewing via Python-list
On 13/01/24 3:14 pm, Chris Angelico wrote: On Sat, 13 Jan 2024 at 13:11, Left Right via Python-list wrote: Very few languages allow arbitrary complex expressions in the same place they allow variable introduction. What do you mean by this? Most languages I've worked with allow variables

Re: Extract lines from file, add to new files

2024-01-13 Thread Greg Ewing via Python-list
On 13/01/24 1:45 pm, Left Right wrote: I use the term "destructuring" in the same way Hyperspec uses it. It's not a Python term. I don't know what you call the same thing in Python. I'm not sure what you understand from it. I thought you meant what is usually called "unpackin

best tool to extract domain hierarchy from a dimension in an OLAP dataset (csv)

2024-01-13 Thread marc nicole via Python-list
Hi all, I have a csv OLAP dataset that I want to extract the domain hierarchies from each of its dimensions. Anybody could recommend a Python tool that could manage this properly? Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract lines from file, add to new files

2024-01-13 Thread Dan Sommers via Python-list
On 2024-01-13 at 11:34:29 +0100, Left Right wrote: > > The Python term, at least colloquially, is "tuple unpacking." That quote is from me. Please do preserve attributions. > Well, why use colloquialism if there's a language specification? Also, > there weren't any tup

Re: Extract lines from file, add to new files

2024-01-12 Thread Dan Sommers via Python-list
On 2024-01-13 at 02:02:39 +0100, Left Right via Python-list wrote: > Actually, after some Web search. I think, based on this: > https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-augtarget > that in Python you call this "augmented assignment tar

Re: Extract lines from file, add to new files

2024-01-12 Thread Chris Angelico via Python-list
On Sat, 13 Jan 2024 at 13:11, Left Right via Python-list wrote: > > Very few > languages allow arbitrary complex expressions in the same place they > allow variable introduction. What do you mean by this? Most languages I've worked with allow variables to be initialized wi

Re: Extract lines from file, add to new files

2024-01-12 Thread Left Right via Python-list
Actually, after some Web search. I think, based on this: https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-augtarget that in Python you call this "augmented assignment target". The term isn't in the glossary, but so are many others. On Sat, Jan 13, 20

Re: Extract lines from file, add to new files

2024-01-12 Thread Left Right via Python-list
> surprising for me: Surprise is subjective, it's based on personal experience. Very few languages allow arbitrary complex expressions in the same place they allow variable introduction. The fact that "i" is not defined is irrelevant to this example. Most programmers who haven't mem

Re: Extract lines from file, add to new files

2024-01-12 Thread Greg Ewing via Python-list
File "", line 1, in NameError: name 'i' is not defined There's no destructuring going on here, just assignment to a sequence item. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract lines from file, add to new files

2024-01-12 Thread Left Right via Python-list
To people discussing BNF: The grammar language Python uses is *very* far from BNF. It's more similar to PEG, but even then it's still quite far. Python's grammar is just its own thing, which makes it harder to read, if you are already familiar with other more popular formats. I've also found

RE: Extract lines from file, add to new files

2024-01-12 Thread Rich Shepard via Python-list
On Fri, 12 Jan 2024, AVI GROSS via Python-list wrote: But is the solution a good one for some purpose? The two output files may end up being out of sync for all kinds of reasons. One of many "errors" can happen if multiple lines in a row do not have an "@" or a person's na

RE: Extract lines from file, add to new files

2024-01-12 Thread AVI GROSS via Python-list
If the data in the input file is exactly as described and consists of alternating lines containing a name and email address, or perhaps an optional blank line, then many solutions are possible using many tools including python programs. But is the solution a good one for some purpose? The two

Re: mypy question

2024-01-12 Thread Antoon Pardon via Python-list
Op 29/12/2023 om 16:02 schreef Karsten Hilbert via Python-list: 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

Re: Extract lines from file, add to new files

2024-01-11 Thread Grizzy Adams via Python-list
Thursday, January 11, 2024 at 10:44, Rich Shepard via Python-list wrote: Re: Extract lines from file, add to (at least in part) >On Thu, 11 Jan 2024, MRAB via Python-list wrote: >> From the look of it: >> 1. If the line is empty, ignore it. >> 2. If the line contains "

Re: Extract lines from file, add to new files

2024-01-11 Thread dn via Python-list
On 12/01/24 12:56, Chris Angelico via Python-list wrote: On Fri, 12 Jan 2024 at 08:56, Left Right via Python-list wrote: By the way, in an attempt to golf this problem, I discovered this, which seems like a parser problem: When you jump immediately to "this is a bug", all you

Re: Extract lines from file, add to new files

2024-01-11 Thread Chris Angelico via Python-list
On Fri, 12 Jan 2024 at 08:56, Left Right via Python-list wrote: > > By the way, in an attempt to golf this problem, I discovered this, > which seems like a parser problem: When you jump immediately to "this is a bug", all you do is make yourself look like an id

Re: Extract lines from file, add to new files

2024-01-11 Thread dn via Python-list
On 12/01/24 10:33, Left Right via Python-list wrote: By the way, in an attempt to golf this problem, I discovered this, which seems like a parser problem: This is what Python tells me about its grammar: with_stmt: | 'with' '(' ','.with_item+ ','? ')' ':' block | 'with' ','.with_item

Re: Extract lines from file, add to new files

2024-01-11 Thread Left Right via Python-list
Ah, nevermind. I need to be more careful, there isn't an "'as' star_target" after the first rule. On Thu, Jan 11, 2024 at 10:33 PM Left Right wrote: > > By the way, in an attempt to golf this problem, I discovered this, > which seems like a parser problem: > > This is w

Re: Extract lines from file, add to new files

2024-01-11 Thread Left Right via Python-list
By the way, in an attempt to golf this problem, I discovered this, which seems like a parser problem: This is what Python tells me about its grammar: with_stmt: | 'with' '(' ','.with_item+ ','? ')' ':' block | 'with' ','.with_item+ ':' [TYPE_COMMENT] block | ASYNC

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: Extract lines from file, add to new files

2024-01-11 Thread Mirko via Python-list
Am 11.01.24 um 20:53 schrieb Rich Shepard via Python-list: On Thu, 11 Jan 2024, Piergiorgio Sartor via Python-list wrote: Why not to use bash script for all? Piergiorgio, That's certainly a possibility, and may well be better than python for this task. Thank you, Rich awk '/@/ {print

Re: Extract lines from file, add to new files

2024-01-11 Thread Rich Shepard via Python-list
On Thu, 11 Jan 2024, Piergiorgio Sartor via Python-list wrote: Why not to use bash script for all? Piergiorgio, That's certainly a possibility, and may well be better than python for this task. Thank you, Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract lines from file, add to new files

2024-01-11 Thread Piergiorgio Sartor via Python-list
On 11/01/2024 19.08, Rich Shepard 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 separate files: salutation.txt and emails.txt. An example

Re: Extract lines from file, add to new files

2024-01-11 Thread Rich Shepard via Python-list
On Thu, 11 Jan 2024, Mats Wichmann via Python-list wrote: 4. Don't assume it's going to be "plain text" if the email info is harvested from external sources (like incoming emails) - you'll end up stumbling over a 誰かのユーザー from somewhere. Process as bytes, or be really careful a

Re: Extract lines from file, add to new files

2024-01-11 Thread Mats Wichmann via Python-list
On 1/11/24 11:27, 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: Extract lines from file, add to new files

2024-01-11 Thread Rich Shepard via Python-list
On Thu, 11 Jan 2024, MRAB via Python-list wrote: From the look of it: 1. If the line is empty, ignore it. 2. If the line contains "@", it's an email address. 3. Otherwise, it's a name. MRAB, Thanks. I'll take it from here. Regards, Rich -- https://mail.python.org/mailman/listi

Re: Extract lines from file, add to new files

2024-01-11 Thread MRAB via Python-list
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 separate files: salutation.txt and emails.txt

Extract lines from file, add to new files

2024-01-11 Thread Rich Shepard via Python-list
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 separate files: salutation.txt and emails.txt. An example of the input file: Calvin cal...@example.com

Re: extend behaviour of assignment operator

2024-01-10 Thread Dieter Maurer via Python-list
v = super().__getattribute__(k) try: v.name = k except TypeError: pass return v ``` -- https://mail.python.org/mailman/listinfo/python-list

extend behaviour of assignment operator

2024-01-10 Thread Guenther Sohler via Python-list
should be: a=cube([10,1,1]) a.name='a' b=a b.name='b' # i am aware that a.name also changes can decorators also be used with assignment operators ? thank you for your hints -- https://mail.python.org/mailman/listinfo/python-list

ANN: repology-client library to access Repology API

2024-01-10 Thread Anna (cybertailor) Vyalkova via Python-list
Hi newsgroup, I needed to fetch Repology data for my pet project and now it's a library: https://pypi.org/project/repology-client/ It uses aiohttp, if that matters. Feel free to use and contribute. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-01-09 Thread 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" from my shebang lines, even if I don't understand > what's happening. Thanks for

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

2024-01-07 Thread Sibylle Koczian via Python-list
Am 01.01.2024 um 12:50 schrieb Barry via Python-list: On 1 Jan 2024, at 11:14, Sibylle Koczian via Python-list wrote: But in all this thread I didn't see a single explanation for my current situation: one and the same shebang line works on Windows 10 / Python 3.11 and doesn't work

Re: Using my routines as functions AND methods

2024-01-06 Thread Peter J. Holzer via Python-list
On 2024-01-03 23:17:34 -0500, Thomas Passin via Python-list 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 qui

Re: Using my routines as functions AND methods

2024-01-04 Thread Guenther Sohler via Python-list
Hi list The approach with defining the methods from python appears to be a very good idea and it also works for classes, defined in python side. However, when I try this one: def mytrans(self): print(self) c=cube() cls=c.__class__ cls.trans=mytrans I get this: Traceback (most recent call

Re: Using my routines as functions AND methods

2024-01-04 Thread Alan Gauld via Python-list
On 04/01/2024 04:17, Thomas Passin via Python-list wrote: >> I'm probably missing something obvious here but can't you >> just assign your function to a class member? >> >> def myFunction(obj, ...): ... >> >> class MyClass: >> myMethod = myFunction

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 firs

Re: Using my routines as functions AND methods

2024-01-03 Thread Guenther Sohler via Python-list
uring parsing translate(object,vec3)"); return NULL; } ... PyMethodDef PyOpenSCADFunctions[] = { {"translate", (PyCFunction) python_translate, METH_VARARGS | METH_KEYWORDS, "Move Object."}, ... static PyModuleDef OpenSCADModule = { PyModuleDef_HEAD_INIT, "o

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: Using my routines as functions AND methods

2024-01-03 Thread Alan Gauld via Python-list
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. > However, I a

Using my routines as functions AND methods

2024-01-03 Thread Guenther Sohler via Python-list
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. on c side this functions looks like: PyObject *python_translate(PyObject *self, PyObject *args, PyObje

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

2024-01-03 Thread Barry Scott via Python-list
> On 2 Jan 2024, at 17:24, Thomas Passin via Python-list > wrote: > > You might learn about this if you happen to read and remember the right part > of the Python docs. Otherwise you have no idea what py.exe is up to nor how > it does it. I would say that most people

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-02 Thread Mats Wichmann via Python-list
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, you can also create an ini file to define to the launche

CoC Warning [was: What is Install-Paths-To in WHEEL file?]

2024-01-02 Thread Ethan Furman via Python-list
On 12/29/23 05:02, Left Right via Python-list wrote: Wow. That place turned out to be the toxic pit I didn't expect. It's a shame that a public discussion of public goods was entrusted to a bunch of gatekeepers with no sense of responsibility for the thing they keep the keys to. Personal

[dead thread] Re: What is Install-Paths-To in WHEEL file?

2024-01-02 Thread Ethan Furman via Python-list
This thread is no longer being useful, and is now closed. -- ~Ethan~ Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: What is Install-Paths-To in WHEEL file?

2024-01-01 Thread Left Right via Python-list
n the first place instead of polling. > if you want to influence anything Usually, when I interact with representatives of Python community I have two goals: 1. Typically, I need to show to someone who's paying my salary why something produced by this community doesn't work. I.e. say, I need to conv

ANN: EmPy 4.0.1

2024-01-01 Thread Erik Max Francis via Python-list
I'm pleased to announce the release of EmPy 4.0.1. The 4._x_ series is a modernization of the software and a revamp of the EmPy system to update its feature set and make it more consistent with the latest Python versions and practices. EmPy 4._x_ was also relicensed to BSD. The 4._x_ series

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 Mats Wichmann via Python-list
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>ftype Python.file Python.file="C:\Windows\py.exe" &

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

2024-01-01 Thread Mats Wichmann via Python-list
On 1/1/24 04:02, 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: 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: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-01 Thread Barry via Python-list
> On 1 Jan 2024, at 11:14, Sibylle Koczian via Python-list > wrote: > > But in all this thread I didn't see a single explanation for my current > situation: one and the same shebang line works on Windows 10 / Python 3.11 > and doesn't work on Windows 11 / Python 3.12.

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

2024-01-01 Thread Sibylle Koczian via Python-list
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 from python.org. When I started to use the language

Re: mypy question

2023-12-31 Thread Karsten Hilbert via Python-list
Thanks to all. I ended up using Sequence for the list part and Mapping for the dict part, which does require "import typing" which I would rather have avoided. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-list

Re: What is Install-Paths-To in WHEEL file?

2023-12-30 Thread Oscar Benjamin via Python-list
https://mail.python.org/mailman/listinfo/python-list

Re: What is Install-Paths-To in WHEEL file?

2023-12-30 Thread Left Right via Python-list
hat this format is a very unfortunate choice for public discussion where there isn't an inherent division between owners and non-owners. Where giving the keys to the common good to a small group of people creates such a division. -- https://mail.python.org/mailman/listinfo/python-list

Re: mypy question

2023-12-30 Thread Greg Ewing via Python-list
too. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Aw: Re: mypy question

2023-12-30 Thread Greg Ewing via Python-list
at's the problem, but the fact that there's a *mutable container* containing that type. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

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: Aw: Re: mypy question

2023-12-30 Thread Chris Angelico via Python-list
On Sun, 31 Dec 2023 at 03:38, Thomas Passin via Python-list wrote: > I am not very expert in Python type hints. In working up the example > program I just posted, I got an error message from mypy that remarked > that "list" is invariant, and to try Sequence which is "cov

Re: mypy question

2023-12-30 Thread Barry via Python-list
> On 30 Dec 2023, at 15:11, Karsten Hilbert via Python-list > wrote: > > queries = [{'SQL': 'SELECT %(value)s', 'args': {'value': 1}}] > > and > > run_queries(conn, queries:list[str|dict[str, Any]]): In cases like this I often use a wrapper class in place of a

Aw: Re: Re: mypy question

2023-12-30 Thread Karsten Hilbert via Python-list
> I'm fairly sure your database queries don't actually give you strings or > dicts, right? You probably get lists (or iterators) of tuples and > somewhere you convert them to the arguments you are feeding to > run_queries(). Ah, no, those queries are enshrined within the middlewa

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[D

Aw: Re: Re: mypy question

2023-12-30 Thread Karsten Hilbert via Python-list
actor them. So, at least that much good has come from the mypy hint ;-) Karsten -- https://mail.python.org/mailman/listinfo/python-list

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

Aw: Re: mypy question

2023-12-30 Thread Karsten Hilbert via Python-list
s:list[str]): or ...a dict holding the SQL and arguments for parameters run_queries(conn, queries:list[dict]): So, taken together: run_queries(conn, queries:list[str|dict]): (yes, this is in Python 3.11/3.12) Now, when it is a list of dicts I want to further constrain the dicts. Each is to contai

Re: Are there any easy-to-use Visual Studio C# WinForms-like GUI designers in the Python world for Tk?

2023-12-30 Thread Alan Gauld via Python-list
On 29/12/2023 01:05, Félix An via Python-list wrote: > I'm used to C# WinForms, which has an easy-to-use drag-and-drop GUI > designer in Visual Studio. Is there anything similar for Tk? How about > Qt? There are any number of them but few that work well. The best I found was Dabo bu

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 understan

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

2023-12-30 Thread Chris Green via Python-list
Peter J. Holzer wrote: > [-- text/plain, encoding quoted-printable, charset: us-ascii, 40 lines --] > > On 2023-12-29 09:01:24 -0800, Grant Edwards via Python-list wrote: > > On 2023-12-28, Peter J. Holzer via Python-list > > wrote: > > > On 2023-12-28 05:20:07

Aw: Re: mypy question

2023-12-30 Thread Karsten Hilbert via Python-list
Hi Greg, > dict[str, str] is not a subtype of dict[str, str | something_else] > because you can assign a value of type something_else to the latter > but not the former. I understand what you are saying but I do not yet understand why this applies to my situation. I don't have Pytho

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

2023-12-30 Thread Peter J. Holzer via Python-list
On 2023-12-29 09:01:24 -0800, Grant Edwards via Python-list wrote: > 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 big

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

2023-12-29 Thread Chris Angelico via Python-list
On Sat, 30 Dec 2023 at 14:06, Mike Dewhirst via Python-list wrote: > > On 29/12/2023 12:09 pm, Félix An via Python-list wrote: > > On 2023-12-25 12:36, Mike Dewhirst wrote: > >> > >> 3. You cannot trust Microsoft. You can trust Python Software > >> Fou

<    1   2   3   4   5   6   7   8   9   10   >