Re: help: pandas and 2d table

2024-04-13 Thread Mats Wichmann via Python-list
On 4/13/24 07:00, jak via Python-list wrote: Stefan Ram ha scritto: jak wrote or quoted: Would you show me the path, please?    I was not able to read xls here, so I used csv instead; Warning:    the script will overwrite file "file_20240412201813_tmp_DML.csv"! import pandas as pd with

Re: ModuleNotFoundError: No module named 'Paramiko'

2024-04-09 Thread Mats Wichmann via Python-list
On 4/7/24 19:31, Wenyong Wei via Python-list wrote: Dear Sir/Madam, Recently I encounter a problem that I can't import paramiko in my computer. My PC running on window 10 64 bits. I have investigate this issue via internet, there are a lot of solutions for this issue, after trying most of

Re: Running issues

2024-04-06 Thread Mats Wichmann via Python-list
On 4/5/24 15:32, 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. they can suggest 3.11 and there might be a good reason for that, but you should not worry about

Re: xkcd.com/353 ( Flying with Python )

2024-03-31 Thread Mats Wichmann via Python-list
On 3/30/24 10:31, MRAB via Python-list wrote: On 2024-03-30 11:25, Skip Montanaro via Python-list wrote: > https://xkcd.com/1306/ >   what does  SIGIL   mean? I think its' a Perl term, referring to the $/@/# symbols in front of identifiers. I wouldn't consider '@' to

Re: the name ``wheel''

2024-03-22 Thread Mats Wichmann via Python-list
On 3/22/24 11:45, Barry via Python-list wrote:  On 22 Mar 2024, at 15:25, Gilmeh Serda via Python-list wrote: Many if not most Linux distributions do not include pip by default. Really? It came with Manjaro. Debian and Ubuntu require you to install pip as a separate package. Also puts

Re: Configuring an object via a dictionary

2024-03-15 Thread Mats Wichmann via Python-list
On 3/15/24 03:30, Loris Bennett via Python-list wrote: Hi, I am initialising an object via the following: self.source_name = config['source_name'] config.get('source_name', default_if_not_defined) is a common technique... --

Re: If a dictionary key has a Python list as its value!

2024-03-07 Thread Mats Wichmann via Python-list
On 3/7/24 07:11, Varuna Seneviratna via Python-list wrote: If a dictionary key has a Python list as its value, you can read the values one by one in the list using a for-loop like in the following. d = {k: [1,2,3]} for v in d[k]: print(v) No tutorial describes this, why? What is the

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

2024-03-06 Thread Mats Wichmann via Python-list
On 3/6/24 05:55, 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: If you import the contents of that file into the python interpreter, dt_expiry will start off as

Re: Can u help me?

2024-03-05 Thread Mats Wichmann via Python-list
On 3/5/24 18:44, Ethan Furman via Python-list wrote: On 3/5/24 16:49, MRAB via Python-list wrote: > On 2024-03-06 00:24, Ethan Furman via Python-list wrote: >> On 3/5/24 16:06, Chano Fucks via Python-list wrote: >> >>> [image: image.png] >> >> The image is of MS-Windows with the python

Re: Using __new__

2024-02-18 Thread Mats Wichmann via Python-list
On 2/17/24 19:24, dn via Python-list wrote: On 18/02/24 13:21, Jonathan Gossage wrote: - perhaps someone knows a better/proper way to do this? Suggested research: custom classes, ABCs, and meta-classes... Cure the old "what do you want to accomplish" question. If it's to channel access

Re: Extract lines from file, add to new files

2024-02-03 Thread Mats Wichmann via Python-list
On 2/3/24 10:58, Thomas Passin via Python-list wrote: In my view this whole thread became murky and complicated because the OP did not write down the requirements for the program.  Requirements are needed to communicate with other people.  An individual may not need to actually write down the

Re: Aw: Re: Extract lines from file, add to new files

2024-01-30 Thread Mats Wichmann via Python-list
On 1/30/24 14:46, AVI GROSS via Python-list wrote: Rich, You may want to broaden your perspective a bit when people make suggestions. Karsten did not spell out a full design and should not need to. But consider this as a scenario. You want to send (almost) the same message to one or more

Re: Assistance Needed: Corrupted Python Installation Uninstallation Issue

2024-01-29 Thread Mats Wichmann via Python-list
On 1/29/24 05:19, Syed Hamood via Python-list wrote: Dear Python.org Support Team, I hope this email finds you well. I am writing to seek assistance with an issue I'm encountering while attempting to uninstall a corrupted Python installation on my system. Details of my system: - Operating

Re: PyTorch

2024-01-17 Thread Mats Wichmann via Python-list
On 1/17/24 09:48, Alan Zaharia via Python-list wrote: Hello Python I Need help. it could not be found for PyTorch. It said in the Command Prompt ERROR: Could not find a version that satisfies the requirement torch (from versions: none) ERROR: No matching distribution found for torch, Can you

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

2024-01-17 Thread Mats Wichmann via Python-list
On 1/16/24 10:00, Sibylle Koczian via Python-list wrote: Am 15.01.2024 um 23:55 schrieb Mats Wichmann via Python-list: On 1/15/24 12:01, Thomas Passin via Python-list wrote: On 1/15/2024 1:26 PM, Mats Wichmann via Python-list wrote: Python from the App Store is not the same as Python from

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

2024-01-15 Thread Mats Wichmann via Python-list
On 1/15/24 12:01, Thomas Passin via Python-list wrote: 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 sh

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

2024-01-15 Thread Mats Wichmann via Python-list
On 1/15/24 09:44, Sibylle Koczian via Python-list wrote: In the Python documentation for versions 3.11 and 3.12 I found no differences regarding py.exe and shebang lines. Then I removed the "/env" from the shebang lines and could start the scripts from the second computer. That certainly is

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

2024-01-15 Thread Mats Wichmann via Python-list
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 Python 3.11.5. They have worked for years on this machine,

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: 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 launcher py which

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" "%L" %* That's not enough. There

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

2023-12-29 Thread Mats Wichmann via Python-list
On 12/29/23 08:02, Karsten Hilbert via Python-list wrote: Dict[str, str] means the key type and value type should both be strings, Indeed, I know that much, list[dict[str, str]] is what is getting passed in in this particular invocation of run_rw_queries(). For what it's worth here's the

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

2023-12-29 Thread Mats Wichmann via Python-list
On 12/28/23 18: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? What do you recommend as the easiest way to create GUI programs in Python, similar to the ease of

Re: mypy question

2023-12-29 Thread Mats Wichmann via Python-list
On 12/29/23 05:15, Karsten Hilbert via Python-list wrote: Hi all, 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 "List[Dict[str, Union[str, List[Any], Dict[str, Any" [arg-type]

Re: Type hints - am I doing it right?

2023-12-13 Thread Mats Wichmann via Python-list
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 with it, but I wondered if there was an easier way. Think of

Re: IDLE editor suggestion.

2023-12-12 Thread Mats Wichmann via Python-list
On 12/12/23 13:50, Thomas Passin via Python-list wrote: 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

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

2023-12-05 Thread Mats Wichmann via Python-list
On 12/5/23 07:37, Chris Green via Python-list wrote: Is there a neat, pythonic way to store values which are 'sometimes' changed? My particular case at the moment is calibration values for ADC inputs which are set by running a calibration program and used by lots of programs which display the

Re: argparse argument post-processing

2023-11-27 Thread Mats Wichmann via Python-list
On 11/27/23 13:21, Dom Grigonis wrote: Thank you, exactly what I was looking for! One more question following this. Is there a way to have a customisable action? I.e. What if I want to join with space in one case and with coma in another. Is there a way to reuse the same action class? I've

Re: argparse argument post-processing

2023-11-27 Thread Mats Wichmann via Python-list
On 11/27/23 04:29, Dom Grigonis via Python-list wrote: Hi all, I have a situation, maybe someone can give some insight. Say I want to have input which is comma separated array (e.g. paths='path1,path2,path3') and convert it to the desired output - list: import argparse parser =

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Mats Wichmann via Python-list
On 11/24/23 14:10, Chris Green via Python-list wrote: Chris Green wrote: This is driving me crazy, I'm running this code:- OK, I've found what's wrong:- cr.execute(sql, ('%' + "2023-11" + '%')) should be:- cr.execute(sql, ('%' + x + '%',) ) I have to say this seems very

Re: xor operator

2023-11-13 Thread Mats Wichmann via Python-list
On 11/13/23 16:24, Dom Grigonis via Python-list wrote: I am not arguing that it is a generalised xor. I don’t want anything, I am just gauging if it is specialised or if there is a need for it. So just thought could suggest it as I have encountered such need several times already. It is

Re: pip/pip3 confusion and keeping up to date

2023-11-06 Thread Mats Wichmann via Python-list
On 11/6/23 14:28, Karsten Hilbert via Python-list wrote: I had just hoped someone here might have a handy pointer for how to deal with modules having to be installed from pip for use with an apt-installed python-based application. That just shouldn't happen - such packages are supposed to be

Re: Checking if email is valid

2023-11-06 Thread Mats Wichmann via Python-list
On 11/6/23 08:23, Jon Ribbens via Python-list wrote: On 2023-11-06, Mats Wichmann wrote: On 11/6/23 01:57, Simon Connah via Python-list wrote: The thing I truly hate is when you have two telephone number fields. One for landline and one for mobile. I mean who in hell has a landline these

Re: Checking if email is valid

2023-11-06 Thread Mats Wichmann via Python-list
On 11/6/23 01:57, Simon Connah via Python-list wrote: The thing I truly hate is when you have two telephone number fields. One for landline and one for mobile. I mean who in hell has a landline these days? People who live in places with spotty, or no, mobile coverage. We do exist. --

Re: Checking if email is valid

2023-11-05 Thread Mats Wichmann via Python-list
On 11/5/23 10:34, Grant Edwards via Python-list wrote: Indeed. There is a tiny but brightly burning kernel of hate in my heart for web sites (and their developers) that refuse to accept credit card numbers entered with spaces _as_they_are_shown_on_the_card_! I've concluded that using PHP

Re: pip/pip3 confusion and keeping up to date

2023-11-02 Thread Mats Wichmann via Python-list
On 11/2/23 04:58, Chris Green via Python-list wrote: I have a couple of systems which used to have python2 as well as python3 but as Ubuntu and Debian verions have moved on they have finally eliminated all dependencies on python2. So they now have only python3 and there is no python executable

Re: Checking if email is valid

2023-11-01 Thread Mats Wichmann via Python-list
On 11/1/23 05:35, Simon Connah via Python-list wrote: OK. I've been doing some reading and that you should avoid regex to check email addresses. So what I was thinking was something like this: To be a little more specific, Avoid Rolling Your Own RegEx. It's very tricky, and you will get it

Re: Too Broad of an exception

2023-10-26 Thread Mats Wichmann via Python-list
On 10/26/23 03:04, Rene Kita via Python-list wrote: Rene Kita wrote: rsutton wrote: Hi all, I am fairly new to python (ie < 2 years). I have a question about pylint. I am running on windows 10/11, python 3.10.11. [...] if p.returncode >= 8: raise Exception(f'Invalid

Re: Running a subprocess in a venv

2023-10-21 Thread Mats Wichmann via Python-list
On 10/21/23 07:01, Larry Martell via Python-list wrote: I have a python script, and from that I want to run another script in a subprocess in a venv. What is the best way to do that? I could write a file that activates the venv then runs the script, then run that file, but that seems messy. Is

Re: Unable to completely remove Python 3.10.9 (64 bit) from Computer

2023-10-05 Thread Mats Wichmann via Python-list
On 10/4/23 13:08, Roland Müller via Python-list wrote: On 25.9.2023 19.58, Pau Vilchez via Python-list wrote:     Hello Python Team,     I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my     computer. I have tried deleting the Appdata folder then repairing and then    

Re: type annotation vs working code

2023-09-30 Thread Mats Wichmann via Python-list
On 9/30/23 13:00, Karsten Hilbert via Python-list wrote: A type annotation isn't supposed to change what code does, or so I thought: # class Borg: _instances:dict = {} def __new__(cls, *args, **kargs):

Re: upgrade of pip on my python 2.7 version

2023-09-27 Thread Mats Wichmann via Python-list
On 9/27/23 14:02, Zuri Shaddai Kuchipudi via Python-list wrote: Why it's trying to select an incompatible version when you ask to upgrade is not something I'd like to speculate on, for me personally that's a surprise. Maybe something else you did before? Also make sure you're using a pip that

Re: path to python in venv

2023-09-27 Thread Mats Wichmann via Python-list
On 9/27/23 13:46, Larry Martell via Python-list wrote: On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: I was under the impression that in a venv the python used would be in the venv's bin dir. But in my venvs I see this in the bin

Re: upgrade of pip on my python 2.7 version

2023-09-27 Thread Mats Wichmann via Python-list
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? C:\repository\pst-utils-pc-davinci-simulator>pip install You are using pip version 7.0.1, however version 23.2.1

Re: Unable to uninstall 3.10.9

2023-09-27 Thread Mats Wichmann via Python-list
On 9/25/23 12:10, Pau Vilchez via Python-list wrote: Hello Python Team, I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my computer. I have tried deleting the Appdata folder then repairing and then uninstalling but it still persists in the remove/add program function in

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

2023-09-18 Thread Mats Wichmann via Python-list
On 9/18/23 12:56, 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]". It's pyproject.toml has a bug: A missing dependency

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

2023-09-18 Thread Mats Wichmann via Python-list
On 9/18/23 02: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]". It's pyproject.toml has a bug: A missing dependency "dateutil". But "dateutil" is not available from PyPi for Python

Re: Imports and dot-notation

2023-08-10 Thread Mats Wichmann via Python-list
On 8/9/23 17:28, dn via Python-list wrote: Side note: Using "...import identifier, ..." does not save storage-space over "import module" (the whole module is imported regardless, IIRC), however it does form an "interface" and thus recommend leaning into the "Interface Segregation Principle",

Re: Setup-tools

2023-07-16 Thread Mats Wichmann via Python-list
On 7/15/23 12:56, MRAB via Python-list wrote: On 2023-07-15 07:12, YOUSEF EZZAT via Python-list wrote: Hey!. i face a problem when i get setup packages by pip when i code this : "pip install numpy" in my command line it gives me error "ModuleNotFoundError: No module named 'distutils'"

Re: Multiple inheritance and a broken super() chain

2023-07-03 Thread Mats Wichmann via Python-list
On 7/3/23 12:13, Mats Wichmann via Python-list wrote: To natter on a bit, and possibly muddy the waters even further... Now, as I see it, from the super()'s point of view, there are two inheritance chains, one starting at Left and the other at Right. But *Right.__init__()* is called twice

Re: Multiple inheritance and a broken super() chain

2023-07-03 Thread Mats Wichmann via Python-list
On 7/3/23 12:01, Richard Damon via Python-list wrote: On 7/3/23 1:38 PM, Peter Slížik via Python-list wrote: Hello. The legacy code I'm working with uses a classic diamond inheritance. Let me call the classes *Top*, *Left*, *Right*, and *Bottom*. This is a trivial textbook example. The

Re: Compiling python on windows with vs

2023-06-13 Thread Mats Wichmann via Python-list
On 6/13/23 12:12, Thomas Schweikle via Python-list wrote: Am Di., 13.Juni.2023 um 19:20:38 schrieb Jim Schwartz: What version of visual studio are you using? Visual Studio 2022, aka 17.6.2. What version of python? python 3.10.11 or 3.11.4 I’ve had success with using the cython package

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

2023-06-07 Thread Mats Wichmann via Python-list
On 6/7/23 10:08, MRAB via Python-list wrote: On 2023-06-07 15:54, Florian Guilbault via Python-list wrote: Dear Python Technical Team, I hope this email finds you well. I am reaching out to you today to seek assistance with an issue I am facing regarding the installation of 'pip' despite my