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

2024-05-18 Thread Mats Wichmann via Python-list
On 5/18/24 10:48, Grant Edwards via Python-list wrote: On 2024-05-18, Peter J. Holzer via Python-list wrote: On 2024-05-16 19:46:07 +0100, Gordinator via Python-list wrote: To be fair, the problem is the fact that they use Windows (but I guess Linux users have to deal with venvs, so we're

Re: Issues with uninstalling python versions on windows server

2024-05-10 Thread Mats Wichmann via Python-list
On 5/10/24 03:39, Tripura Seersha via Python-list wrote: Hi Barry, Automation is using the system account using which the installation is failing with exit code 3. This account has the administrative privileges. Please help me with this issue. Thanks, Seersha You probably have a better

Re: Issues with uninstalling python versions on windows server

2024-05-04 Thread Mats Wichmann via Python-list
On 5/3/24 05:55, Tripura Seersha via Python-list wrote: Hi Team, I am working on an automation related to uninstalling and installing python versions on different windows servers. I have observed that uninstallation is working only with the account/login using which the python version is

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 days

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

Re: What to use instead of nntplib?

2023-05-30 Thread Mats Wichmann
On 5/22/23 17:59, Grant Edwards wrote: On 2023-05-22, Keith Thompson wrote: My understanding is that nntplib isn't being erased from reality, it's merely being removed from the set of modules that are provided by default. I presume that once it's removed from the core, it will still be

Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-05-22 Thread Mats Wichmann
On 5/20/23 13:53, Chris Green wrote: I'm converting a bash script to python as it has become rather clumsy in bash. However I have hit a problem with converting dates, the bash script has:- dat=$(date --date "$1" +"%Y/%m/%d") and this will accept almost anything reasonably sensible that

Re: Error installing packages or upgrading pip

2023-05-20 Thread Mats Wichmann
On 5/18/23 04:30, Test Only wrote: Hi there, I hope you are in a great health I am having a problem with python even though I uninstall and reinstall it again multiple times Ummm... there's usually not a great reason to do that. I know it's the traditional "Windows Way" of the past, but

Re: Learning tkinter

2023-05-18 Thread Mats Wichmann
On 5/18/23 08:50, Jim Schwartz wrote: This works for me. Hope it helps. from tkinter import messagebox messagebox.showerror("Hi", f"Hello World") It's probably instructive that IDLE always brings it in this way. Lib/idlelib/config_key.py:from tkinter import messagebox

Re: Tkinter (related)~

2023-05-18 Thread Mats Wichmann
On 5/18/23 10:06, Jack Dangler wrote: I didn't want to hijack another thread... I thought the OP of the tkinter thread currently running may have needed to install the tkinter package (since I had the same missing component error message), so I tried to install the package on to my Ubu laptop

Re: What to use instead of nntplib?

2023-05-16 Thread Mats Wichmann
On 5/15/23 20:12, Grant Edwards wrote: On 2023-05-15, Skip Montanaro wrote: I got a nice warning today from the inews utility I use daily: DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13 What should I use in place of nntplib? I'd recommend

Re: PythonPath / sys.path

2023-05-14 Thread Mats Wichmann
On 5/14/23 13:00, Grizzy Adams via Python-list wrote: Sunday, May 14, 2023 at 11:11, Mats Wichmann wrote: Re: PythonPath / sys.path (at least in part) On 5/14/23 10:43, Barry wrote: I take it you have business reasons to use an obsolete version python. Where did you get your version

Re: PythonPath / sys.path

2023-05-14 Thread Mats Wichmann
On 5/14/23 10:43, Barry wrote: I take it you have business reasons to use an obsolete version python. Where did you get your version of python from? In fact, a *nine* year old version of Python that reached end-of-life four years ago. Just sayin' Python version shouldn't have anything to

Re: pip module not found

2023-05-12 Thread Mats Wichmann
On 5/12/23 00:42, David John wrote: Hi, I recently have been experiencing issues with the pip installation module. How? Please be explicit or nobody can answer your question. -- https://mail.python.org/mailman/listinfo/python-list

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-10 Thread Mats Wichmann
On 5/10/23 12:51, Dieter Maurer wrote: Horst Koiner wrote at 2023-5-9 11:13 -0700: ... For production i run the program with stdout=subprocess.PIPE and i can fetch than the output later. For just testing if the program works, i run with stdout=subprocess.STDOUT and I see all program output on

Re: Black boxes

2023-05-10 Thread Mats Wichmann
On 5/10/23 08:19, Ondřej Jůn wrote: Good day. After installing the Python program from your site and restarting the computer as requested by the program, problems occurred. That's rather suspicious, because the python installer doesn't do that. That's only needed if you replace files in use

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-09 Thread Mats Wichmann
On 5/9/23 12:13, Horst Koiner wrote: Hi @all, i'm running a program which is still in development with subprocess.run (Python version 3.10), further i need to capture the output of the program in a python variable. The program itself runs about 2 minutes, but it can also freeze in case of new

Re: Disable 'style PEP' messages

2023-05-04 Thread Mats Wichmann
On 5/4/23 10:28, Kevin M. Wilson via Python-list wrote: Hi... How do I set Pycharm to find only syntax errors?!! By configuring PyCharm the way you want. See PyCharm's documentation for how to do that. Hint: Settings -> Editor -> Code Style -> Inspections --

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Mats Wichmann
On 4/28/23 11:05, MRAB wrote: On 2023-04-28 16:55, Chris Green wrote: I'm sure I'm missing something obvious here but I can't see an elegant way to do this.  I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in

Re: How to 'ignore' an error in Python?

2023-04-28 Thread Mats Wichmann
On 4/28/23 09:55, Chris Green wrote: I'm sure I'm missing something obvious here but I can't see an elegant way to do this. I want to create a directory, but if it exists it's not an error and the code should just continue. So, I have:- for dirname in listofdirs: try:

Re: Is npyscreen still alive?

2023-04-24 Thread Mats Wichmann
On 4/24/23 10:32, Grant Edwards wrote: On 2023-04-24, Grant Edwards wrote: The other big advantage of an ncurses program is that since curses support is in the std library, a curses app is simpler to distribute. Right now, the application is a single .py file you just copy to the destination

Re: Incomplete sys.path with embeddable python (Windows)!?

2023-04-23 Thread Mats Wichmann
On 4/22/23 16:04, Ralf M. wrote: Am 21.04.2023 um 18:07 schrieb Thomas Passin: On 4/20/2023 5:47 PM, Ralf M. wrote: Hello, when I run a script with a "normally" installed python, the directory the script resides in is automatically added as first element to sys.path, so that "import

Re: Incomplete sys.path with embeddable python (Windows)!?

2023-04-21 Thread Mats Wichmann
On 4/20/23 15:47, Ralf M. wrote: Hello, when I run a script with a "normally" installed python, the directory the script resides in is automatically added as first element to sys.path, so that "import my_local_module" finds my_local_module.py in the directory of the script. However, when I

Re: PyCharm's strict PEP and not so strict?

2023-04-20 Thread Mats Wichmann
On 4/19/23 17:19, dn via Python-list wrote: The "light bulb" has little to do with "quotes"! This is one of the advantages of utilising a Python-native IDE (cf a more general-purpose alternative, perhaps with some Python add-on). PyCharm attempts to understand the code it is editing, and

Re: Weak Type Ability for Python

2023-04-12 Thread Mats Wichmann
On 4/12/23 11:11, Chris Angelico wrote: On Thu, 13 Apr 2023 at 03:05, Ali Mohseni Roodbari wrote: Hi all, Please make this command for Python (if possible): x=1 y='a' wprint (x+y) 1a In fact make a new type of print command which can print and show strings and integers together. Try:

Re: Christoph Gohlke and compiled packages

2023-04-11 Thread Mats Wichmann
On 4/11/23 11:48, Oscar Benjamin wrote: On Tue, 11 Apr 2023 at 14:55, Mats Wichmann wrote: On 4/11/23 06:03, Roel Schroeven wrote: Op 11/04/2023 om 12:58 schreef Chris Angelico: Python itself is fine, but a lot of third-party packages are hard to obtain. So if you need numpy, for instance

Re: Christoph Gohlke and compiled packages

2023-04-11 Thread Mats Wichmann
On 4/11/23 06:03, Roel Schroeven wrote: Op 11/04/2023 om 12:58 schreef Chris Angelico: Python itself is fine, but a lot of third-party packages are hard to obtain. So if you need numpy, for instance, or psycopg2, you might need to find an alternative source. These days I use pip to install

Re: Problem in using libraries

2023-04-04 Thread Mats Wichmann
On 4/3/23 10:43, Pranav Bhardwaj wrote: Why can't I able to use python libraries such as numpy, nudenet, playsound, pandas, etc in my python 3.11.2. It always through the error "import 'numpy' or any other libraries could not be resolved". Will restate what others have said in the hopes it

Re: Windows Gui Frontend

2023-04-01 Thread Mats Wichmann
On 4/1/23 11:34, Eryk Sun wrote: On 4/1/23, Jim Schwartz wrote: Are there any ide’s that will let me design the screen and convert it to python? I doubt it because it was mentioned that this is time consuming. Thanks for the responses everyone. I appreciate it. For Qt, the WYSIWYG UI

Re: Ole version set as default

2023-03-29 Thread Mats Wichmann
On 3/29/23 10:46, Pranav Bhardwaj wrote: Dear sir, I am Pranav Bhardwaj and I stuck in a problem. My problem is that in my system I have python 3.11.2 but when I type python in my command prompt, my command prompt show that python version 2.7.13 as a default. And I can't be able

Re: recent-files

2023-03-28 Thread Mats Wichmann
On 3/28/23 16:39, g...@uol.com.br wrote: In Python 3.11.2,  the recent-files list keeps always increasing because it is impossible to edit the list; the corresponding .txt file has disappeared. Please help! Please explain what you're asking about. What recent-files list? Python

Re: How does a method of a subclass become a method of the base class?

2023-03-27 Thread Mats Wichmann
On 3/26/23 17:53, Jen Kris via Python-list wrote: I’m asking all these question because I have worked in a procedural style for many years, with class work limited to only simple classes, but now I’m studying classes in more depth. The three answers I have received today, including yours,

Re: Patrick Sheehan: Major Issues with Python

2023-03-26 Thread Mats Wichmann
On 3/25/23 14:03, Patrick Sheehan wrote: Hello, I have been working with the attached book (See photo) to try to learn Python and so far it has been a complete nightmare trying to get python installed and operating correctly. I have received a plethora of error messages and consulted youtube

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-23 Thread Mats Wichmann
On 3/23/23 09:48, Thomas Passin wrote: I didn't realize that Christoph Gohlke is still maintaining this site. Unless the the last-changed stuff stopped working, it's in a static state: by Christoph Gohlke. Updated on 26 June 2022 at 07:27 UTC --

Re: Friday finking: IDE 'macro expansions'

2023-03-16 Thread Mats Wichmann
On 3/16/23 16:55, dn via Python-list wrote: It is a long, long, time since I've thrown one of these into the maelstrom of our musings. (have the nightmares receded?) Do you make use of your IDE's expansionist tendencies, and if-so, which ones? NB this is where vi/emacs enthusiasts start

Re: Cryptic software announcements (was: ANN: DIPY 1.6.0)

2023-03-05 Thread Mats Wichmann
On 3/1/23 04:57, Rob Cliffe via Python-list wrote: I think it would be a good idea if software announcements would include a single paragraph (or maybe just a single sentence) summarizing what the software is and does. hp +1 Rob Cliffe Excellent adivce - and many of the

Re: Regular Expression bug?

2023-03-02 Thread Mats Wichmann
On 3/2/23 12:28, Chris Angelico wrote: On Fri, 3 Mar 2023 at 06:24, jose isaias cabrera wrote: Greetings. For the RegExp Gurus, consider the following python3 code: import re s = "pn=align upgrade sd=2023-02-" ro = re.compile(r"pn=(.+) ") r0=ro.match(s) print(r0.group(1)) align upgrade

Re: How to fix this issue

2023-03-01 Thread Mats Wichmann
On 2/27/23 17:51, Arslan Mehmood wrote: How I can remove python terminl, its again and again open during working in python. Please help me to resolve this issue. Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32 Type "help", "copyright", "credits"

Re: Python 3.10 Fizzbuzz

2023-02-28 Thread Mats Wichmann
On 2/27/23 16:42, Oscar Benjamin wrote: On Mon, 27 Feb 2023 at 21:06, Ethan Furman wrote: On 2/27/23 12:20, rbowman wrote: > "By using Black, you agree to cede control over minutiae of hand- > formatting. In return, Black gives you speed, determinism, and freedom > from pycodestyle

Re: Python 3.10 Fizzbuzz

2023-02-27 Thread Mats Wichmann
On 2/26/23 14:07, Hen Hanna wrote: On Monday, August 29, 2022 at 7:18:22 PM UTC-7, Paul Rubin wrote: Just because. from math import gcd def fizz(n: int) -> str: match gcd(n, 15): case 3: return "Fizz" case 5: return "Buzz" case 15: return

Re: Not receiving posts

2023-02-24 Thread Mats Wichmann
On 2/23/23 13:56, Grant Edwards wrote: On 2023-02-23, Jim Byrnes wrote: I have been reading the python-list for some time now. At first via gemane and since it's demise via a subscription. FWIW, gmane is still there, and still working fine. I read this list by pointing slrn at news.gmane.io

Re: putting JUNK at the end of a [.py] file

2023-02-24 Thread Mats Wichmann
On 2/24/23 08:27, Mats Wichmann wrote: Indeed, I work on a project that by convention puts editor instructions at the end of each file (which some might consider junk :-) ), like this: # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth

Re: putting JUNK at the end of a [.py] file

2023-02-24 Thread Mats Wichmann
On 2/23/23 22:16, Thomas Passin wrote: On 2/23/2023 7:21 PM, Hen Hanna wrote: in a LaTeX file,   after the (1st)   \end{document} line,    i can put any random Junk i want    (afterwards)   until the end of the file. Is there a similar Method  for a    .py file ? Since

Re: lxml with python-3.12.0a5

2023-02-23 Thread Mats Wichmann
On 2/23/23 07:47, Mats Wichmann wrote: On 2/23/23 06:03, Robin Becker wrote: I'm trying to test python-3.12.0a5 and need to install lxml. My wheel build for lxml fails with errors like this src/lxml/etree.c: In function ‘__Pyx_PyIndex_AsSsize_t’: src/lxml/etree.c:270404:45: error

Re: lxml with python-3.12.0a5

2023-02-23 Thread Mats Wichmann
On 2/23/23 06:03, Robin Becker wrote: I'm trying to test python-3.12.0a5 and need to install lxml. My wheel build for lxml fails with errors like this src/lxml/etree.c: In function ‘__Pyx_PyIndex_AsSsize_t’: src/lxml/etree.c:270404:45: error: ‘PyLongObject’ {aka ‘struct _longobject’} has no

Re: Python + Vim editor

2023-02-22 Thread Mats Wichmann
On 2/22/23 11:16, Tramiv wrote: On 2023-02-22, Hen Hanna wrote: what editor do you (all) use to write Python code? (i use Vim) For short editin I also use Vim and Pycharm IDE for bigger projects. The community has submitted some answers to that question here (two lists, some entrants

Re: File write, weird behaviour

2023-02-19 Thread Mats Wichmann
On 2/19/23 14:06, Dieter Maurer wrote: Azizbek Khamdamov wrote at 2023-2-19 19:03 +0500: ... Example 2 (weird behaviour) file = open("D:\Programming\Python\working_with_files\cities.txt", 'r+') ## contains list cities # the following code DOES NOT add new record TO THE BEGINNING of the file IF

Re: Precision Tail-off?

2023-02-17 Thread Mats Wichmann
On 2/17/23 11:42, Richard Damon wrote: On 2/17/23 5:27 AM, Stephen Tucker wrote: The key factor here is IEEE floating point is storing numbers in BINARY, not DECIMAL, so a multiply by 1000 will change the representation of the number, and thus the possible resolution errors. Store you

  1   2   3   4   >