Re: Conda create with python version fails me

2025-11-14 Thread Martin Schöön via Python-list
Den 2025-11-13 skrev Loris Bennett : Hi Loris, Thanks for quick respons. > Martin Schöön writes: > >> >> I want to create a new environment using a specific python version >> rather than leaving that to conda. Cheat-sheets and online conda >> documentation tell me to use: >> >> conda create -n

Conda create with python version fails me

2025-11-13 Thread Martin Schöön via Python-list
About two years ago I moved from pip to conda. I have been happy with conda until yesterday. I want to create a new environment using a specific python version rather than leaving that to conda. Cheat-sheets and online conda documentation tell me to use: conda create -n python= like: conda cr

Proposal: private keyword for import statements to hide module dependencies

2025-11-21 Thread Bjørnar Remmen via Python-list
Hi, this is my first time here on the mailing list. I would like to open up for a discussion on how we can introduce a way to hide imports. I am proposing the introduction of an optional, non-breaking keyword, private, to be used when importing a file. The goal is to allow developer to hide in

Re: Conda create with python version fails me

2025-11-17 Thread Martin Schöön via Python-list
Den 2025-11-14 skrev Stefan Ram : > Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or quoted: >>If I try to specify a python version I don't get a new environment. The >>error message I get is: >>"The following packages are missing from the target environment: >> - python=3.10" >> (if I asked for ver

Re: Sending FDs over UNIX domain sockets

2025-11-15 Thread Grant Edwards via Python-list
On 2025-11-16, Pokemon Chw via Python-list wrote: > On Linux AF_UNIX + SOCK_STREAM sockets, there is a quirk in how the > kernel handles control messages with SCM_RIGHTS: > > To successfully pass file descriptors via SCM_RIGHTS, you must send > at least one byte of normal d

Fwd: zipapp: add compression (method), compresslevel options from Zipfile

2025-11-17 Thread Mingye Wang via Python-list
-Rahmaan Janhangeer wrote: > > You have some demo code for it? > > > Kind Regards, > > Abdur-Rahmaan Janhangeer > about | blog > github > Mauritius > > On Mon, 10 Nov 2025, 07:18 Mingye Wang via Python-list, > wrote: >> >> Zipapp is meant to

Re: Proposal: private keyword for import statements to hide module dependencies

2025-11-25 Thread Michael Torrie via Python-list
On 11/25/25 1:42 PM, bjotta via Python-list wrote: > I want to be able to restrict / name mangle the usage. > To avoid this being possible. > > ''' > from library.math import np. > ''' Fascinating. I would never have thought to do an import like th

Re: Proposal: private keyword for import statements to hide module dependencies

2025-11-30 Thread Bjørnar Remmen via Python-list
I agree that some of my reasoning was off and it does not directly with the issue of sub-dependencies. However, the Idea was more on how to hide it rather than the dependency issue itself. Anyways, I agree that an approach on name mangling might be more in line with what we have in python. Ho

Re: A switch somewhere, or bug?

2025-12-06 Thread Pierre Fortin via Python-list
On Thu, 4 Dec 2025 11:06:21 -0500 Em wrote: >Two computers, both alike in dignity, in fair windows land... > >in Win10/Python 3.13 my program runs as well as can be expected. However, on >my new computer Win11/Python 3.14.1 there is a peculiarity. > >On the new machine, when I click on the file na

Re: A switch somewhere, or bug? CORRECTION

2025-12-05 Thread Michael Torrie via Python-list
On 12/4/25 10:47 PM, Em wrote: >> Starter = open("HLYlog.txt", "w") >> >> Thoughts appreciated. > > -That's a relative path. Are you sure that the current working directory is > what > -you expect? It's generally better to work with absolute paths. > > Relative or not, I can't see how that could

Re: A switch somewhere, or bug? CORRECTION

2025-12-05 Thread Chris Angelico via Python-list
On Sat, 6 Dec 2025 at 15:52, Michael Torrie via Python-list wrote: > > On 12/5/25 6:36 PM, Chris Angelico via Python-list wrote: > > On Sat, 6 Dec 2025 at 12:33, Michael Torrie via Python-list > > wrote: > >> Starter = open("HLYlog.txt","w"); >

Re: A switch somewhere, or bug? CORRECTION

2025-12-05 Thread Chris Angelico via Python-list
On Sat, 6 Dec 2025 at 18:22, Michael Torrie wrote: > > On Sat, Dec 6, 2025, 00:04 Chris Angelico wrote: >> >> On Sat, 6 Dec 2025 at 15:52, Michael Torrie via Python-list >> wrote: >> > >> > On 12/5/25 6:36 PM, Chris Angelico via Python-list wrote: &

Re: A switch somewhere, or bug? CORRECTION

2025-12-05 Thread Michael Torrie via Python-list
On Sat, Dec 6, 2025, 00:04 Chris Angelico wrote: > On Sat, 6 Dec 2025 at 15:52, Michael Torrie via Python-list > wrote: > > > > On 12/5/25 6:36 PM, Chris Angelico via Python-list wrote: > > > On Sat, 6 Dec 2025 at 12:33, Michael Torrie via Python-list > >

Re: Proposal: private keyword for import statements to hide module dependencies

2025-12-02 Thread Bjørnar Remmen via Python-list
Richard Damon wrote: > On 11/25/25 3:42 PM, bjotta via Python-list wrote: > > It seem like you are talking about classes and sub-classes. I was talking > > about dependencies in projects. > > The technique is currently defined only for class and sub-classes, but > coul

Re: Are PyQt5 questions/issues accepted here?

2025-12-02 Thread Chris Angelico via Python-list
On Wed, 3 Dec 2025 at 07:41, Rich Shepard wrote: > > I'm learning PyQt5 and will have questions now and then when I can't find > answers in Fitzpatrick's book or in a web search. There are several web fora > for Qt and PyQt support but I much prefer maillists where threads are pushed > to me and I

Re: Are PyQt5 questions/issues accepted here?

2025-12-03 Thread Sibylle Koczian via Python-list
I wonder nobody mentioned the dedicated PyQt mailing list: https://riverbankcomputing.com/support/lists Mainly PyQt6, but I don't think questions about older versions are forbidden. -- https://mail.python.org/mailman3//lists/python-list.python.org

Fwd: Re: A switch somewhere, or bug? CORRECTION

2025-12-04 Thread Alan Gauld via Python-list
On 04/12/2025 18:25, Em wrote: > in Win10/Python 3.13 my program runs as well as can be expected. However, on > my new computer Win11/Python 3.14.1 there is a peculiarity. > > On the new machine, when I click on the file name, it immediately dumps out. What exactly does "dumps out" mean? A blu

Re: Are PyQt5 questions/issues accepted here?

2025-12-04 Thread Michael Torrie via Python-list
Qt's documentation is quite good. Here are the official python Qt docs on the subject of slots in Qt 6 (PySide2): https://doc.qt.io/qtforpython-6/tutorials/basictutorial/signals_and_slots.html In short you decorate them with @Slot(params) where params are a list of the Qt types your slot is expec

Re: Rock Paper Scissors Code Bug?

2025-12-08 Thread John Smith via Python-list
Thanks for the recommendations. I'm building a whole new version based on the old one, with simpler code and functions to find win stats. -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: A switch somewhere, or bug? CORRECTION

2025-12-05 Thread Michael Torrie via Python-list
On 12/5/25 6:36 PM, Chris Angelico via Python-list wrote: > On Sat, 6 Dec 2025 at 12:33, Michael Torrie via Python-list > wrote: >> Starter = open("HLYlog.txt","w"); >> filepath = Starter.name > > Isn't that just... > > filepath = "H

Re: A switch somewhere, or bug? CORRECTION

2025-12-05 Thread Michael Torrie via Python-list
On 12/5/25 5:12 PM, Em wrote: > Ok, using "Open with Python" , the program fails on both computers. > Still, double-click the filename on the WIN10 computer and the program > works. > While, double-click the filename on the WIN11 computer and the program > fails. Here's a test script for you that

Re: A switch somewhere, or bug? CORRECTION

2025-12-05 Thread Chris Angelico via Python-list
On Sat, 6 Dec 2025 at 12:33, Michael Torrie via Python-list wrote: > Starter = open("HLYlog.txt","w"); > filepath = Starter.name Isn't that just... filepath = "HLYlog.txt" ? ChrisA -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: What is the tool used here?

2025-12-07 Thread Grant Edwards via Python-list
On 2025-12-07, Em wrote: > I see >, >>, and >>>, attached at the beginning of lines in messages. I > doubt that they are placed manually and wonder how they are placed > automatically. How do I get said program? I use slrn and emacs. [Just emerge both of them.] Then I point slrn at the gmane

Re: What is the tool used here?

2025-12-07 Thread Alan Gauld via Python-list
On 07/12/2025 16:25, Em wrote: > I see >, >>, and >>>, attached at the beginning of lines in messages. I > doubt that they are placed manually and wonder how they are placed > automatically. How do I get said program? I use Thunderbird and it provide the same feature. You are not limited to > sy

Re: A switch somewhere, or bug? CORRECTION

2025-12-07 Thread Sibylle Koczian via Python-list
Hello, Am 07.12.2025 um 15:36 schrieb Em: -Original Message- From: Roel Schroeven Sent: Sunday, December 7, 2025 7:23 AM To: [email protected] Subject: Re: A switch somewhere, or bug? CORRECTION Op 7/12/2025 om 1:54 schreef Thomas Passin: As I explained in my last post, that's

Re: A switch somewhere, or bug? CORRECTION

2025-12-07 Thread Michael Torrie via Python-list
On 12/7/25 3:03 AM, Em wrote: > So, is this a change from WIN10? Maybe. It could be a change in the pylauncher. Or a change in how Windows starts pylauncher. It could be a difference between the versino of Python Microsoft puts in the store vs the python.org package. It could be a change in how

Re: A switch somewhere, or bug? CORRECTION

2025-12-07 Thread Michael Torrie via Python-list
On 12/7/25 5:22 AM, Roel Schroeven wrote: > Op 7/12/2025 om 1:54 schreef Thomas Passin: >> As I explained in my last post, that's because in Windows 11 when >> double-clicking, the working directory is the system's Windows >> directory, not the one your program is in. > Irrespective of anything e

Re: Rock Paper Scissors Code Bug?

2025-12-08 Thread Chris Angelico via Python-list
On Tue, 9 Dec 2025 at 05:29, via Python-list wrote: > > I coded Rock, Paper, Scissors. I added the randomness, made it loop at the > user's request, added win code, no problems there. I changed some strings to > F-strings to practice using them, and now the first "elif&quo

Re: Rock Paper Scissors Code Bug?

2025-12-08 Thread Jason Friedman via Python-list
> > > I coded Rock, Paper, Scissors. I added the randomness, made it loop at the > user's request, added win code, no problems there. I changed some strings > to F-strings to practice using them, and now the first "elif" in my if loop > (player chooses rock, bot chooses paper) doesn't work. Any hel

Re: Rock Paper Scissors Code Bug?

2025-12-08 Thread John Smith via Python-list
Thanks for the tip. I'll do that here and in future games. -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Python

2025-12-15 Thread Greg Ewing via Python-list
Any decent programming editor will have a facility for selecting a group of lines and adding/removing the appropriate commenting characters. (If your editor doesn't have that, then by definition it's not decent. :-) -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Python

2025-12-16 Thread Michael Torrie via Python-list
On 12/16/25 1:12 AM, Left Right via Python-list wrote: > Nobody should be encouraged to change their editor. Neither do you > know why the person chose the editor they chose, nor do you actually > help in solving the problem the person has. Well the fact is an editor that does not

Re: Python

2025-12-16 Thread Left Right via Python-list
> Well the fact is an editor that does not automate indenting blocks to > one degree or another will make Python much more difficult to learn and > use, and his experience with Python will not be positive. The editor > not making Python indenting easy to manage is in reality the problem the > orig

Re: Python

2025-12-16 Thread Left Right via Python-list
difficulties that changing such a decision would entail. So, like it or not, the indentation-driven structure will stay in Python in the overseeable future. On Tue, Dec 16, 2025 at 5:58 AM Greg Ewing via Python-list wrote: > > Any decent programming editor will have a facility for sel

Issues compiling Python 3.14.2 on Rhel 8.10

2025-12-16 Thread Mads Boye via Python-list
Hi. I am currently facing issues compiling Python 3.14.2 on my RHEL 8 server. It seems to relate to the --enable-optimizations argument. If I build with out the --enable-optimizations it is finalizing the build, but with the argument, it segfaults during the "test_functools" ./configure not wor

Re: Python

2025-12-16 Thread Chris Angelico via Python-list
On Wed, 17 Dec 2025 at 10:33, Left Right via Python-list wrote: > No. Again. This is not your place. Not anyone else's to suggest users > switch their editor to anything else. What you do is just being a jerk > by not admitting the problem with Python and blaming it on the user.

Re: Rock Paper Scissors Code Bug?

2025-12-18 Thread Gregg Drennan via Python-list
the four valid choices...we just treat it as invalid and prompt the player to enter a valid choice. On Thu, Dec 18, 2025, 8:21 AM Thomas Passin wrote: > On 12/17/2025 10:43 PM, Gregg Drennan via Python-list wrote: > > The other recommendation i would make is to shorten the response the &g

Re: Python

2025-12-17 Thread Dan Espen via Python-list
Lawrence D’Oliveiro writes: > On Mon, 15 Dec 2025 12:57:57 +, mm0fmf wrote: > >> On 14 Dec 2025 11:56:42 GMT, Stéphane CARPENTIER wrote: >> >>> My issues with python are: >>> - It's using indentations, so when I comment a block of code to see >> >> ''' and ''' are your friend > > Unless the

Re: Python

2025-12-17 Thread Chris Angelico via Python-list
On Thu, 18 Dec 2025 at 18:01, c186282 wrote: >Oh, I usually write "i=i+2". It's a bit more >clear and becomes the same code anyway. += >is more a 'C' thing. As are semicolons and /* */ comments. ChrisA -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Rock Paper Scissors Code Bug?

2025-12-17 Thread Gregg Drennan via Python-list
e print("Invalid choice...") else: If player_choice[0].lower() == "q": print("Thanks for playing. Good-bye.") break # code to score the choices, blah, blah, blah Good luck with your new version! On Mon, Dec 8, 20

Re: Python

2025-12-18 Thread Alan Gauld via Python-list
On 18/12/2025 14:40, Peter Flass wrote: > ...I've almost never looked at a program and > said "I wish it had fewer comments." Sadly I have. In one notable example we sub-contracted the coding out to an external company and the contract specified some code "quality metrics" one of these was the r

i3 (was: Python)

2025-12-19 Thread Axel Reichert via Python-list
rbowman writes: > I use i3/sway and I have a moment of hesitation of whether Meta-h or > Meta-v is going to split the way I want. 'I want two panes stacked > vertically so that's 'h'. Or is it 'v'?' >From my i3 config file: bindsym Mod4+v split toggle Since I do have window borders, the spli

advice for inventory software

2017-11-30 Thread Brian J. Oney via Python-list
Dear Python scripters, I am writing modules for my insectary (for food), the processes of which I plan to mostly automate. Currently, inventory and the traceability of material flows is my focus. My best idea (yet) for making things as simple as possible consists of a debian server hooked up t

Re: Python Templating Language

2017-12-17 Thread Brian J. Oney via Python-list
I am not exactly sure what you mean, so I will guess. Jinja may be what you're looking for. It's an important component of flask & ansible, for example. pyweave may also serve your purposes. HTH -- https://mail.python.org/mailman/listinfo/python-list

Problem with coroutines old-style / new-style usage and features

2018-02-01 Thread Yahya Abou 'Imran via Python-list
Hi guys. I am discovering coroutines and asynchronous programming, and I have a little problem with a little example I'm coding myself as an excercice. Let say you take two guys in the street: Dave and Bryan. You ask dave to count from 1 to 50, 1 by 1. He will do it fast. And you ask Bryan to co

Re: Problem with coroutines old-style / new-style usage and features

2018-02-01 Thread Yahya Abou 'Imran via Python-list
>> @asyncio.coroutine >> def recorder(): >> dialog = [] >> while True: >> sent = yield dialog >> if sent is not None: >> name, things = sent >> dialog.append(f'{name} says : {things}') >This is not an asyncio coroutine. This is just a normal generator that > you're sending to. So you should probabl

Spam levels.

2018-02-10 Thread C W Rose via Python-list
I've been reading a limited range of Usenet groups since the late 1980s, and until the recent problems in comp.lang.python had never bothered with any sort of filtering; it's easier just to ignore people. However, the sheer volume of spam in comp.lang.python finally defeated me, so I set up a fil

Respam levels.

2018-02-13 Thread C W Rose via Python-list
Having run a check for straightforward spam, I now find that there's a site editing and reposting non-spam posts. An example of the changed headers follows: Original post headers: > > From [email protected] Sun Feb 11 23:23:22 2018 > Path: > eternal-september.org!reader02.eternal-september.org!

Re: error of opening Python

2022-05-02 Thread ARRYAN SINHA (RA1811029010036) via Python-list
On Friday, April 15, 2022 at 2:17:28 AM UTC+5:30, Andrew Hernandez wrote: > that is not an error, its simply the python console intrepeter how do I open this file -- https://mail.python.org/mailman/listinfo/python-list

F-string usage in a print()

2022-05-24 Thread Kevin M. Wilson via Python-list
future_value = 0 for i in range(years): # for i in range(months): future_value += monthly_investment future_value = round(future_value, 2) # monthly_interest_amount = future_value * monthly_interest_rate # future_value += monthly_interest_amount # display the result print(f"Year =

Re: Conecting to MySQL

2022-08-09 Thread Dan Ciprus (dciprus) via Python-list
ither not running or you have a problem with the configuration. On Tue, Aug 09, 2022 at 08:27:16AM -0700, Axy via Python-list wrote: trying to connect to MYSQL it appears the error msg below: InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (111 Connec

Re: Conecting to MySQL

2022-08-09 Thread Dan Ciprus (dciprus) via Python-list
I'm not sure about this but this mailing list does not allow attachments ... On Tue, Aug 09, 2022 at 12:45:33PM -0300, Guilherme Campos wrote: Hi Igor, Accessing mysql-workbench it appeared new error messages when I clicked Server Status. I created my database on MySQL Workbench . Is that you

Re: not able to use python

2022-08-17 Thread Dan Ciprus (dciprus) via Python-list
Those people keep me on my toes every time I look at such a message :-/. On Wed, Aug 17, 2022 at 12:35:28PM -0500, Igor Korot wrote: Hi, On Wed, Aug 17, 2022 at 12:20 PM i am unable to use python wrote: AND I"M UNABLE TO SEE ANYTHING IN YOUR MESSAGE... THANK YOU. Sent from [1]Ma

ImportError: No module named spambayes.resources (line 12 of setup_all.py)

2022-08-24 Thread Erik M. Brown via Python-list
Is anyone here familiar with SpamBayes? I am working with legacy 2.4.x Python code (I'm not a programmer, more of a power user) and I'm attempting to build the windows binary from the SpamBayes source. I'm running into an error when attempting to run "setup_all.py", the py2exe setup script,

Help, PyCharm fails to recognize my tab setting...See attached picture of the code.

2022-10-10 Thread Kevin M. Wilson via Python-list
C:\Users\kevin\PycharmProjects\Myfuturevalue\venv\Scripts\python.exe C:\Users\kevin\PycharmProjects\Myfuturevalue\FutureValueCal.py   File "C:\Users\kevin\PycharmProjects\Myfuturevalue\FutureValueCal.py", line 31    elif (years > 50.0) or (years < 1.0) :    ^IndentationError: expected an indent

Pycharm IDE

2023-04-18 Thread Kevin M. Wilson via Python-list
Greetings... Kevin here:I need help, as you have guessed!I have this line: The Print Statement... Why complain about a 'comma', or a ')'???def play_game(): number = random.randint(1, LIMIT) print (f'"I am thinking of a number between 1 to {LIMIT}\n")Or is this a setting in the IDE, I need

Re: Pycharm IDE

2023-04-18 Thread Kevin M. Wilson via Python-list
print (f'"I am thinking of a number between 1 to {LIMIT}\n")I had the impression that the format specifier 'f' was necessary for the print function, but the double quotes are for the string printed to the user, as a prompt!The Pycharm IDE is showing that it expects a single quotation mark or ')'

Re: Pycharm IDE

2023-04-18 Thread Kevin M. Wilson via Python-list
u: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze."      Isaiah 43:2 On Tuesday, April 18, 2023 at 11:17:52 PM MDT, Kevin M. Wilson via Python-list wrote: print (f'

PyCharm's strict PEP and not so strict?

2023-04-19 Thread Kevin M. Wilson via Python-list
Greetings,     I'm in a bit of a quandary, I want some strict syntax errors to be flagged, but the use of single quotes vs double quotes! NOT what I need from the 'checker', you dig? As I've recently returned to the IDE, and no longer have the "stones" for bull, how do I set up the kind of "

Editing PEP-8, in particular "expected 2 blanks, found 1

2023-05-02 Thread Kevin M. Wilson via Python-list
Folks, help please! What the @#$! are these doing popping up. Code styles are personal, and not subject to debate.Where can I edit these out of my IDE? Kevin "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk th

Disable 'style PEP' messages

2023-05-04 Thread Kevin M. Wilson via Python-list
Hi... How do I set Pycharm to find only syntax errors?!! "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze."      Isaiah 43:2 | |

Three (3) >>> in the debug screen of PyCharm... Que Es over?!!

2023-05-04 Thread Kevin M. Wilson via Python-list
"When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze."      Isaiah 43:2 | | Virus-free.www.avg.com | -- https://mail.python.org/m

Invalid literal for int() with base 10?

2023-05-25 Thread Kevin M. Wilson via Python-list
Ok, I'm not finding any info. on the int() for converting a str to an int (that specifies a base parameter)?! The picture is of the code I've written... And the base 10 paradigm involved?? years = int('y') # store for calculationValueError: invalid literal for int() with base 10: 'y'What is mean

From geeksforgeeks.org, on converting the string created by the input() to an INT

2023-05-25 Thread Kevin M. Wilson via Python-list
We can first convert the string representation of float into float using  float() function and then convert it into an integer using int().So, why can't a string of an integer be converted to an integer, via  print(int(str('23.5')))??? Perplexed | print(int(float('23.5'))) | "When you pas

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

2023-05-25 Thread Kevin M. Wilson via Python-list
e."      Isaiah 43:2 On Thursday, May 25, 2023 at 05:55:06 PM MDT, Kevin M. Wilson via Python-list wrote: Ok, I'm not finding any info. on the int() for converting a str to an int (that specifies a base parameter)?! The picture is of the code I've written... And the

Re: Assistance Request - Issue with Installing 'pip' despite Python 3.10 Installation

2023-06-08 Thread Dennis Lee Bieber via Python-list
On Wed, 7 Jun 2023 10:36:22 -0600, Mats Wichmann declaimed the following: >I'm assuming you checked - say, with Explorer - that pip.exe really is >where you think it is? >Anyway, if you ask a Windows shell (cmd) to locate it, and it doesn't, >then your PATH is not set up correctly after all.

Re: Assistance Request - Issue with Installing 'pip' despite Python 3.10 Installation

2023-06-09 Thread Dennis Lee Bieber via Python-list
On Thu, 8 Jun 2023 17:22:22 -0400, Thomas Passin declaimed the following: >On 6/8/2023 3:14 PM, Dennis Lee Bieber via Python-list wrote: > C:\Users\Owner> >> -=-=- >> Windows PowerShell >> Copyright (C) Microsoft Corporation. All rights reserved. >> >>

Re: Assistance Request - Issue with Installing 'pip' despite Python 3.10 Installation

2023-06-11 Thread Dennis Lee Bieber via Python-list
On Sat, 10 Jun 2023 11:32:53 -0500, Eryk Sun declaimed the following: >On 6/10/23, Thomas Passin via Python-list wrote: >> >> We can find pip.exe using good old-fashioned dir (we don't need any >> new-fangled Powershell): >> >> C:\Users\tom>dir AppData

Re: Bug in io.TextIOWrapper?

2023-06-19 Thread Peter J. Holzer via Python-list
On 2023-06-20 02:15:00 +0900, Inada Naoki via Python-list wrote: > stream.flush() doesn't mean final output. > Try stream.close() After close() the value isn't available any more: Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux Type "help", "co

Where is the error?

2023-08-06 Thread Peter J. Holzer via Python-list
Mostly, error messages got a lot better in Python 3.10, but this one had me scratching my head for a few minutes. Consider this useless and faulty script: r = { "x": (1 + 2 + 3) "y": (4 + 5 + 6) "z": (7 + 8 + 9)

Re: Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread Peter J. Holzer via Python-list
On 2023-08-30 11:32:02 +, c.buhtz--- via Python-list wrote: > I do use "textwrap" package to wrap longer texts passages. Works well with > English. > But the source string used is translated via gettext before it is wrapped. > > Using languages like Japanese or Chi

Re: Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread Peter J. Holzer via Python-list
On 2023-08-30 13:18:25 +, c.buhtz--- via Python-list wrote: > Am 30.08.2023 14:07 schrieb Peter J. Holzer via Python-list: > > another caveat: Japanese characters are usually double-width. So > > (unless your line length is 130 characters for English) you would > > want t

Re: What sort of exception when a class can't find something?

2023-08-31 Thread Peter J. Holzer via Python-list
On 2023-08-31 21:32:04 +0100, Chris Green via Python-list wrote: > What sort of exception should a class raise in __init__() when it > can't find an appropriate set of data for the parameter passed in to > the class instantiation? > > E.g. I have a database with some names and

Passing info to function used in re.sub

2023-09-03 Thread Jan Erik Moström via Python-list
I'm looking for some advice for how to write this in a clean way I want to replace some text using a regex-pattern, but before creating replacement text I need to some file checking/copying etc. My code right now look something like this: def fix_stuff(m): # Do various things that invol

Re: Passing info to function used in re.sub

2023-09-03 Thread Jan Erik Moström via Python-list
On 3 Sep 2023, at 19:13, MRAB via Python-list wrote: > You could use pass an anonymous function (a lambda) to re.sub: Of course !! Thanks. = jem -- https://mail.python.org/mailman/listinfo/python-list

Re: Passing info to function used in re.sub

2023-09-04 Thread Peter J. Holzer via Python-list
On 2023-09-03 18:10:29 +0200, Jan Erik Moström via Python-list wrote: > I want to replace some text using a regex-pattern, but before creating > replacement text I need to some file checking/copying etc. My code > right now look something like this: > > def fix_stuff(m): >

Re: Passing info to function used in re.sub

2023-09-05 Thread Jan Erik Moström via Python-list
On 3 Sep 2023, at 18:10, Jan Erik Moström via Python-list wrote: > I'm looking for some advice for how to write this in a clean way Thanks for all the suggestion, I realize that I haven't written Python code in a while. I should have remembered this myself !!! Thanks for remindi

Postgresql equivalent of Python's timeit?

2023-09-15 Thread Albert-Jan Roskam via Python-list
Hi, This is more related to Postgresql than to Python, I hope this is ok. I want to measure Postgres queries N times, much like Python timeit (https://docs.python.org/3/library/timeit.html). I know about EXPLAIN ANALYZE and psql \timing, but there's quite a bit of variation in the

Re: Postgresql equivalent of Python's timeit?

2023-09-15 Thread Peter J. Holzer via Python-list
On 2023-09-15 17:42:06 +0200, Albert-Jan Roskam via Python-list wrote: >This is more related to Postgresql than to Python, I hope this is ok. >I want to measure Postgres queries N times, much like Python timeit >(https://docs.python.org/3/library/timeit.html). I know abou

Re: `time.perf_counter_ns` always a 64-bit int?

2023-09-16 Thread Peter J. Holzer via Python-list
On 2023-09-15 21:48:37 +, rmlibre--- via Python-list wrote: > I'd like to capture the output of `time.perf_counter_ns()` as an 8-byte > timestamp. > > I'm aware that the docs provide an undefined start value for that clock. > I'm going to assume that means it can

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Albert-Jan Roskam via Python-list
On Sep 15, 2023 19:45, "Peter J. Holzer via Python-list" wrote: On 2023-09-15 17:42:06 +0200, Albert-Jan Roskam via Python-list wrote: >    This is more related to Postgresql than to Python, I hope this is ok. >    I want to measure Postgres queries N

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Peter J. Holzer via Python-list
On 2023-09-17 11:01:43 +0200, Albert-Jan Roskam via Python-list wrote: >On Sep 15, 2023 19:45, "Peter J. Holzer via Python-list" > wrote: > > On 2023-09-15 17:42:06 +0200, Albert-Jan Roskam via Python-list wrote: > >    This is more related to Postg

Re: PEP668 / pipx and "--editable" installs

2023-09-18 Thread Peter J. Holzer via Python-list
On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: > I tried to install it via "pipx install -e .[develop]". It's pyproject.toml > has a bug: A missing dependency "dateutil". But "dateutil" is not available > from PyPi for Python 3.11 (th

Re: PEP668 / pipx and "--editable" installs

2023-09-20 Thread Peter J. Holzer via Python-list
On 2023-09-18 18:56:35 +, c.buhtz--- via Python-list wrote: > On 2023-09-18 10:16 "Peter J. Holzer via Python-list" > wrote: > > On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: > > > I tried to install it via "pipx install -e .[develop]"

dateutil on PyPI (was: PEP668 / pipx and "--editable" installs)

2023-09-20 Thread Peter J. Holzer via Python-list
On 2023-09-20 13:31:14 +, c.buhtz--- via Python-list wrote: > Dear Peter, > > maybe we have a missunderstanding. > > Am 20.09.2023 14:43 schrieb Peter J. Holzer via Python-list: > > > > > "dateutil" is not available from PyPi for Python 3.11 > >

Re: error of opening Python

2023-09-26 Thread Michael F. Stemper via Python-list
On 26/09/2023 07.27, Abdelkhelk ashref salay eabakh wrote: Dear Python team, This is my not first time using Python, I tried to launch Python and it showed "Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "l

Re: error of opening Python

2023-09-26 Thread Chris Roy-Smith via Python-list
On 26/9/23 22:27, Abdelkhelk ashref salay eabakh via Python-list wrote: Dear Python team, This is my not first time using Python, I tried to launch Python and it showed I'm no expert but "Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD6

upgrade of pip on my python 2.7 version

2023-09-27 Thread Zuri Shaddai Kuchipudi via Python-list
hello everyone this the error that im getting while trying to install and upgrade pip on what is the solution for it? C:\repository\pst-utils-pc-davinci-simulator>pip install You are using pip version 7.0.1, however version 23.2.1 is available. You should consider upgrading via the 'pip install -

Re: upgrade of pip on my python 2.7 version

2023-09-27 Thread Zuri Shaddai Kuchipudi via Python-list
On Wednesday, 27 September 2023 at 21:32:53 UTC+2, Mats Wichmann wrote: > On 9/27/23 05:17, Zuri Shaddai Kuchipudi via Python-list wrote: > > hello everyone this the error that im getting while trying to install and > > upgrade pip on what is the solution for it? > >

Re: path to python in venv

2023-09-27 Thread Peter J. Holzer via Python-list
On 2023-09-27 20:32:25 -, Jon Ribbens via Python-list wrote: > On 2023-09-27, Larry Martell wrote: > > On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via > > Python-list wrote: > >> On 2023-09-27, Larry Martell wrote: > >> > lrwxrwxrwx 1 larrymartell l

Re: upgrade of pip on my python 2.7 version

2023-09-28 Thread Zuri Shaddai Kuchipudi via Python-list
On Wednesday, 27 September 2023 at 23:33:02 UTC+2, Chris Angelico wrote: > On Thu, 28 Sept 2023 at 07:27, Mats Wichmann via Python-list > wrote: > > > > Upgrading to Python 3 is the best answer... except when it isn't. If > > you want to convert a small project i

Re: Python 3.12.0 venv not working with psycopg2

2023-10-02 Thread Peter J. Holzer via Python-list
On 2023-10-02 19:44:12 +0300, אורי via Python-list wrote: > I have an issue since about 5 months now. Python 3.12.0 venv not working > with psycopg2 on Windows. I created 2 issues on GitHub but they were > closed. I checked today with the new Python release but it's still not > wo

Re: regarding installation of python version

2023-10-09 Thread Sravan Kumar Chitikesi via Python-list
I can help you On Mon, 9 Oct 2023, 11:15 pm Thri sowmya.G via Python-list, < [email protected]> wrote: > > >The problem is how many times I have uninstalled the python version but >always it is showing the same version after the installation of new >ver

Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list
On 24/10/2023 17.50, Thomas Passin wrote: The programming team for the Apollo moon mission developed a system which,> if you would write your requirements in a certain way, could generate correct C code for them. Since the last Apollo mission was in 1972, when C was first being developed,

Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list
On 24/10/2023 18.15, o1bigtenor wrote: What is interesting about this is the absolute certainty that it is impossible to program so that that program is provably correct. Not entirely true. If I was to write a program to calculate Fibonacci numbers, or echo back user input, that program could

Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list
On 25/10/2023 05.45, o1bigtenor wrote: On Tue, Oct 24, 2023 at 8:35 PM Chris Angelico via Python-list wrote: 3. Catch the failure before you commit and push. Unit tests are great for this. Where might I find such please. You don't "find" unit tests; you write them. A un

Re: xor operator

2023-11-14 Thread Peter J. Holzer via Python-list
On 2023-11-14 00:11:30 +0200, Dom Grigonis via Python-list wrote: > Benchmarks: > test1 = [False] * 100 + [True] * 2 > test2 = [True] * 100 + [False] * 2 > > TIMER.repeat([ > lambda: xor(test1), # 0.0168 > lambda: xor(test2), # 0.0172 > lambda:

Re: xor operator

2023-11-15 Thread Peter J. Holzer via Python-list
On 2023-11-15 12:26:32 +0200, Dom Grigonis wrote: > > Thank you, > > > test2 = [True] * 100 + [False] * 2 > test2i = list(range(100)) > > %timeit len(set(test2i)) == 1 # 1.6 µs ± 63.6 ns per loop (mean ± std. dev. > of 7 runs, 1,000,000 loops each) > %timeit all(test2) # 386 ns

Re: Code improvement question

2023-11-17 Thread Peter J. Holzer via Python-list
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

Re: Code improvement question

2023-11-17 Thread Peter J. Holzer via Python-list
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 readability a lot if you have to > &g

<    51   52   53   54   55   56   57   58   59   >