Can't trap paramiko runtime trace-back error

2024-05-22 Thread Vinode Singh Ujlain via Python-list
When running the code below , I get error as enumerated below. Why am I not able to trap this paramiko runtime traceback in try-except block ? Exception (client): Error reading SSH protocol banner Traceback (most recent call last):   File

Re: Cprod -- (writing this: itertools.product([0, 1], repeat=N )

2024-05-22 Thread HenHanna via Python-list
dn wrote: On 22/05/24 07:14, HenHanna via Python-list wrote: How can i write this function Cprod (Cartesian Product) simply?     (writing this out: itertools.product([0, 1], repeat=N ) The value can be a list or a Tuple.     cprod([0, 1], 1) => ((0) (1))

Re: Cprod -- (writing this: itertools.product([0, 1], repeat=N )

2024-05-21 Thread dn via Python-list
On 22/05/24 07:14, HenHanna via Python-list wrote: How can i write this function Cprod (Cartesian Product) simply?     (writing this out: itertools.product([0, 1], repeat=N ) The value can be a list or a Tuple.     cprod([0, 1], 1) => ((0) (1))    

Cprod -- (writing this: itertools.product([0, 1], repeat=N )

2024-05-21 Thread HenHanna via Python-list
How can i write this function Cprod (Cartesian Product) simply? (writing this out: itertools.product([0, 1], repeat=N ) The value can be a list or a Tuple. cprod([0, 1], 1) => ((0) (1)) cprod([0, 1], 2) => ((0,0) (0,1) (1,0) (1,1)) This

Re: pip and venvs on Debian

2024-05-21 Thread Roel Schroeven via Python-list
Op 20/05/2024 om 23:48 schreef Akkana Peck via Python-list: Every so often I need to regenerate it (like when Debian updates the system Python version) but that's easy to do: I don't try to duplicate what's installed there, I just delete the old venv, create a new one and then pip install

pip and venvs on Debian (was: Terminal Emulator)

2024-05-20 Thread Akkana Peck via Python-list
Alan Gauld via Python-list writes: > On 18/05/2024 19:12, Piergiorgio Sartor via Python-list wrote: > > >> So venvs make managing all that pretty convenient. Dunno why everybody's > >> so down on venvs... > > Not so much down on them, they are just one extra step that's > mostly not needed(in

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

2024-05-20 Thread Gordinator via Python-list
On 20/05/2024 10:58, Peter J. Holzer wrote: On 2024-05-20 00:26:03 +0200, Roel Schroeven via Python-list wrote: Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: Modern debian (ubuntu) and fedora block users installing using pip. Even if you're telling it to install in ~/.local?

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

2024-05-20 Thread Gordinator via Python-list
I'm on Manjaro Of course, I'm not here to tell you how to use your computer, and it's great that you're using Linux, but I'd suggest that you look into installing Arch Linux proper. Arch Linux isn't as difficult as people make it out to be (I'd argue that anyone who's had to deal with the

Re: venvs vs. package management

2024-05-20 Thread Left Right via Python-list
There are several independent problems here: 1. Very short release cycle. This is independent of the Python venv module but is indirectly influenced by Python's own release cycle. Package maintainers don't have time for proper testing, they are encouraged to release a bunch of new (and poorly

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

2024-05-20 Thread Peter J. Holzer via Python-list
On 2024-05-20 00:26:03 +0200, Roel Schroeven via Python-list wrote: > Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: > > > Modern debian (ubuntu) and fedora block users installing using pip. > > > > Even if you're telling it to install in ~/.local? I could see not allowing > > to

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

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 6:00 PM, Karsten Hilbert via Python-list wrote: Am Sun, May 19, 2024 at 10:45:09PM +0100 schrieb Barry via Python-list: On 18 May 2024, at 16:27, Peter J. Holzer via Python-list wrote: I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block

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

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 6:34 PM, Grant Edwards via Python-list wrote: On 2024-05-19, Barry via Python-list wrote: On 18 May 2024, at 16:27, Peter J. Holzer via Python-list wrote: I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block users installing using pip.

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

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 6:08 PM, Skip Montanaro via Python-list wrote: Modern debian (ubuntu) and fedora block users installing using pip. Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I honestly haven't tried. Maybe I should... 樂 I have an old laptop

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

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Barry via Python-list wrote: > > >> On 18 May 2024, at 16:27, Peter J. Holzer via Python-list >> wrote: >> >> I don't think Linux users have to deal with venvs > > Modern debian (ubuntu) and fedora block users installing using pip. You can't even use pip to do "user" installs?

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

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Gilmeh Serda via Python-list wrote: > On Sun, 19 May 2024 08:32:46 +0100, Alan Gauld wrote: > >> I've honestly never experienced this "nightmare". >> I install stuff and it just works. > > Hear! Hear! Me too! And all that. > > I'm on Manjaro, which is a tad finicky about other

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

2024-05-19 Thread Roel Schroeven via Python-list
Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: Modern debian (ubuntu) and fedora block users installing using pip. > Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I assumed pip install --user would work, but no. I tried it (on

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

2024-05-19 Thread Skip Montanaro via Python-list
Modern debian (ubuntu) and fedora block users installing using pip. > Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I honestly haven't tried. Maybe I should... 樂 I have an old laptop running XUbuntu 22.04 which I generally only use to compile the

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

2024-05-19 Thread Karsten Hilbert via Python-list
Am Sun, May 19, 2024 at 10:45:09PM +0100 schrieb Barry via Python-list: > > On 18 May 2024, at 16:27, Peter J. Holzer via Python-list > > wrote: > > > > I don't think Linux users have to deal with venvs > > Modern debian (ubuntu) and fedora block users installing using pip. > You must use a

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

2024-05-19 Thread Barry via Python-list
> On 18 May 2024, at 16:27, Peter J. Holzer via Python-list > wrote: > > I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block users installing using pip. You must use a venv to pip install packages from pypi now. This is implemented in python and pip and

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

2024-05-19 Thread Dan Sommers via Python-list
On 2024-05-19 at 18:13:23 +, Gilmeh Serda via Python-list wrote: > Was there a reason they chose the name Pip? Package Installer for Python https://pip.pypa.io/en/stable/index.html -- https://mail.python.org/mailman/listinfo/python-list

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

2024-05-19 Thread MRAB via Python-list
On 2024-05-19 19:13, Gilmeh Serda via Python-list wrote: On Sun, 19 May 2024 08:32:46 +0100, Alan Gauld wrote: I've honestly never experienced this "nightmare". I install stuff and it just works. Hear! Hear! Me too! And all that. I'm on Manjaro, which is a tad finicky about other people

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

2024-05-19 Thread Dan Sommers via Python-list
On 2024-05-19 at 18:13:23 +, Gilmeh Serda via Python-list wrote: > Was there a reason they chose the name Pip? Package Installer for Python https://pip.pypa.io/en/stable/index.html Every time I see PIP, I think Peripheral Interchange Program, but I'm old. --

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

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 3:32 AM, Alan Gauld via Python-list wrote: On 18/05/2024 19:12, Piergiorgio Sartor via Python-list wrote: [snip] The dependency nightmare created by python, pip and all the rest cannot be resolved otherwise. I've honestly never experienced this "nightmare". I install stuff

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

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Alan Gauld via Python-list wrote: >> The dependency nightmare created by python, pip >> and all the rest cannot be resolved otherwise. > > I've honestly never experienced this "nightmare". > I install stuff and it just works. Same here. I occasonlly use pip to install something

Re: venvs vs. package management

2024-05-19 Thread Piergiorgio Sartor via Python-list
On 19/05/2024 08.49, Peter J. Holzer wrote: [...] That's what package management on Linux is for. Sure, it means that you won't have the newest version of anything and some packages not at all, but you don't have to care about dependencies. Or updates. Well, that doesn't work as well.

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

2024-05-19 Thread Alan Gauld via Python-list
On 18/05/2024 19:12, Piergiorgio Sartor via Python-list wrote: >> So venvs make managing all that pretty convenient. Dunno why everybody's >> so down on venvs... Not so much down on them, they are just one extra step that's mostly not needed(in my use case) > Only people which are *not* using

venvs vs. package management (was: Terminal Emulator (Posting On Python-List Prohibited))

2024-05-19 Thread Peter J. Holzer via Python-list
On 2024-05-18 20:12:33 +0200, Piergiorgio Sartor via Python-list wrote: > On 18/05/2024 20.04, Mats Wichmann wrote: > > So venvs make managing all that pretty convenient. Dunno why everybody's > > so down on venvs... > > Only people which are *not* using python... :-) > > In my experience, venvs

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

2024-05-18 Thread Piergiorgio Sartor via Python-list
On 18/05/2024 20.04, Mats Wichmann wrote: [...] So venvs make managing all that pretty convenient. Dunno why everybody's so down on venvs... Only people which are *not* using python... :-) In my experience, venvs is the only possible way to use python properly. The dependency nightmare

Re: Terminal Emulator

2024-05-18 Thread Piergiorgio Sartor via Python-list
On 14/05/2024 19.44, Gordinator wrote: I wish to write a terminal emulator in Python. I am a fairly competent Python user, and I wish to try a new project idea. What references can I use when writing my terminal emulator? I wish for it to be a true terminal emulator as well, not just a Tk text

Re: PyCon

2024-05-18 Thread Abdur-Rahmaan Janhangeer via Python-list
Two interesting ones: - Norwegian library: https://fosstodon.org/@osdotsystem/112459312723574625 - One about if Ai will take our jobs, using py to find out and she concludes it will On Sat, 18 May 2024, 14:15 Chris Angelico via Python-list, < python-list@python.org> wrote: > On Sun, 19 May 2024

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

2024-05-18 Thread Grant Edwards via Python-list
On 2024-05-18, Mats Wichmann via Python-list wrote: > Distros have do offer a good selection of packaged Python bits, yes, but > only for the version of Python that's "native" to that distro release. > If you need to test other versions of Python, you're mostly on your own. For a few years I

Re: PyCon

2024-05-18 Thread Chris Angelico via Python-list
On Sun, 19 May 2024 at 04:10, Abdur-Rahmaan Janhangeer via Python-list wrote: > > Yes, this year's pretty exciting, great keynotes, great lightnings, great > location, great even sponsor talks (thought they would be pumping a lot of > marketing, but the ones i went were pretty awesome

Re: PyCon

2024-05-18 Thread Abdur-Rahmaan Janhangeer via Python-list
Yes, this year's pretty exciting, great keynotes, great lightnings, great location, great even sponsor talks (thought they would be pumping a lot of marketing, but the ones i went were pretty awesome technically) Organization side pretty smooth as well  On Fri, 17 May 2024, 20:58 Larry Martell

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: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-18 Thread Grant Edwards via Python-list
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 even. > > I don't think Linux users have to deal

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

2024-05-18 Thread Peter J. Holzer via Python-list
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 even. I don't think Linux users have to deal with venvs any more than Windows users. Maybe even less because

Re: Terminal Emulator

2024-05-18 Thread Peter J. Holzer via Python-list
On 2024-05-14 22:37:17 +0200, Mirko via Python-list wrote: > Am 14.05.24 um 19:44 schrieb Gordinator via Python-list: > > I wish to write a terminal emulator in Python. I am a fairly competent > > Python user, and I wish to try a new project idea. What references can I > > use when writing my

Re: Terminal Emulator

2024-05-18 Thread Peter J. Holzer via Python-list
On 2024-05-14 16:03:33 -0400, Grant Edwards via Python-list wrote: > On 2024-05-14, Alan Gauld via Python-list wrote: > > On 14/05/2024 18:44, Gordinator via Python-list wrote: > > > >> I wish to write a terminal emulator in Python. I am a fairly > >> competent Python user, and I wish to try a

Re: PyCon

2024-05-18 Thread Chris Angelico via Python-list
On Sat, 18 May 2024 at 21:44, Skip Montanaro via Python-list wrote: > > > > > > I’m at PyCon in Pittsburgh and I’m haven’t an amazing time! > > > > s/haven’t/having/ > > > > No need to explain/correct. We understand you are excited. Many of us have > been in the same state before. ;-) > We're

Re: PyCon

2024-05-18 Thread Skip Montanaro via Python-list
> > > I’m at PyCon in Pittsburgh and I’m haven’t an amazing time! > > s/haven’t/having/ > No need to explain/correct. We understand you are excited. Many of us have been in the same state before. ;-) Enjoy, Skip > -- https://mail.python.org/mailman/listinfo/python-list

Re: PyCon

2024-05-17 Thread Larry Martell via Python-list
LOn Fri, May 17, 2024 at 8:57 PM Larry Martell wrote: > I’m at PyCon in Pittsburgh and I’m haven’t an amazing time! s/haven’t/having/ -- https://mail.python.org/mailman/listinfo/python-list

PyCon

2024-05-17 Thread Larry Martell via Python-list
I’m at PyCon in Pittsburgh and I’m haven’t an amazing time! -- https://mail.python.org/mailman/listinfo/python-list

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

2024-05-16 Thread Gordinator via Python-list
On 16/05/2024 01:12, Lawrence D'Oliveiro wrote: On 15 May 2024 10:31:25 GMT, Stefan Ram wrote: We need somethin like a portable curses module (plus colorama) and it has got to work on both Windoze and Linux straight out of the box in standard Python. Something else for Windows Python users

Re: Version of NymPy

2024-05-16 Thread Left Right via Python-list
Let me try to answer this properly, instead of "simply". The "problematic" part of your question is "with my Anaconda distribution". Anaconda distribution comes with the conda program that manages installed packages. A single Anaconda distribution may have multiple NumPy versions installed at the

Re: Terminal Emulator

2024-05-16 Thread Gordinator via Python-list
We need somethin like a portable curses module (plus colorama) Agreed, getting curses to work on Windows is SUCH a pain, and I don't think I've ever done it. Naturally, as a Linux user, I don't find much need to do it anyway. Colorama would also be cool in the standard library as well. I

Re: Version of NymPy

2024-05-15 Thread MRAB via Python-list
On 2024-05-15 19:42, Popov, Dmitry Yu via Python-list wrote: What would be the easiest way to learn which version of NumPy I have with my Anaconda distribution? Import numpy and print its '__version__' attribute. -- https://mail.python.org/mailman/listinfo/python-list

Re: Version of NymPy

2024-05-15 Thread Popov, Dmitry Yu via Python-list
Thank you. From: Larry Martell Sent: Wednesday, May 15, 2024 1:55 PM To: Popov, Dmitry Yu Cc: Popov, Dmitry Yu via Python-list Subject: Re: Version of NymPy On Wed, May 15, 2024 at 2: 43 PM Popov, Dmitry Yu via Python-list wrote: > > What would be the easiest

Re: Version of NymPy

2024-05-15 Thread Larry Martell via Python-list
On Wed, May 15, 2024 at 2:43 PM Popov, Dmitry Yu via Python-list wrote: > > What would be the easiest way to learn which version of NumPy I have with my > Anaconda distribution? >>> import numpy >>> numpy.__version__ '1.24.4' -- https://mail.python.org/mailman/listinfo/python-list

Version of NymPy

2024-05-15 Thread Popov, Dmitry Yu via Python-list
What would be the easiest way to learn which version of NumPy I have with my Anaconda distribution? -- https://mail.python.org/mailman/listinfo/python-list

Re: Terminal Emulator

2024-05-14 Thread Cameron Simpson via Python-list
On 14May2024 18:44, Gordinator wrote: I wish to write a terminal emulator in Python. I am a fairly competent Python user, and I wish to try a new project idea. What references can I use when writing my terminal emulator? I wish for it to be a true terminal emulator as well, not just a Tk text

RE: Terminal Emulator

2024-05-14 Thread AVI GROSS via Python-list
The topic was to re-invent the wheel yet again and create a terminal emulator. I hesitate to say this but one approach is to consider the curses module as described by our very own Alan Gauld in a book: https://www.amazon.com/Programming-curses-Python-Alan-Gauld-ebook/dp/B091B85 B77 The topic

Re: Terminal Emulator

2024-05-14 Thread Mirko via Python-list
Am 14.05.24 um 19:44 schrieb Gordinator via Python-list: I wish to write a terminal emulator in Python. I am a fairly competent Python user, and I wish to try a new project idea. What references can I use when writing my terminal emulator? I wish for it to be a true terminal emulator as well,

Re: Terminal Emulator

2024-05-14 Thread Grant Edwards via Python-list
On 2024-05-14, Alan Gauld via Python-list wrote: > On 14/05/2024 18:44, Gordinator via Python-list wrote: > >> I wish to write a terminal emulator in Python. I am a fairly >> competent Python user, and I wish to try a new project idea. What >> references can I use when writing my terminal

Re: Terminal Emulator

2024-05-14 Thread Grant Edwards via Python-list
On 2024-05-14, Alan Gauld via Python-list wrote: > On 14/05/2024 18:44, Gordinator via Python-list wrote: > >> I wish to write a terminal emulator in Python. I am a fairly >> competent Python user, and I wish to try a new project idea. What >> references can I use when writing my terminal

Re: Terminal Emulator

2024-05-14 Thread Alan Gauld via Python-list
On 14/05/2024 18:44, Gordinator via Python-list wrote: > I wish to write a terminal emulator in Python. I am a fairly competent > Python user, and I wish to try a new project idea. What references can I > use when writing my terminal emulator? I wish for it to be a true > terminal emulator as

Terminal Emulator

2024-05-14 Thread Gordinator via Python-list
I wish to write a terminal emulator in Python. I am a fairly competent Python user, and I wish to try a new project idea. What references can I use when writing my terminal emulator? I wish for it to be a true terminal emulator as well, not just a Tk text widget or something like that. If you

Re: help

2024-05-13 Thread Thomas Passin via Python-list
On 5/12/2024 7:56 PM, Enrder via Python-list wrote: good tader I need help to install the bcml, and is that after installing the python and I go to the command prompt and put ''pip install bcml'' to install it tells me "pip" is not recognized as an internal or external command,

help

2024-05-13 Thread Enrder via Python-list
good tader I need help to install the bcml, and is that after installing the python and I go to the command prompt and put ''pip install bcml'' to install it tells me "pip" is not recognized as an internal or external command, program or executable batch file. I have tried

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-10 Thread Tripura Seersha via Python-list
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 From: Python-list on behalf of Tripura Seersha via

[RELEASE] Python 3.13.0 beta 1 released

2024-05-08 Thread Thomas Wouters via Python-list
After a little bit of excitement discovering new bugs during the release, *it’s done*: 3.13.0 beta 1 is released, the 3.13 branch has been created, and features for 3.13 are frozen! The main branch is now 3.14.0a0. https://www.python.org/downloads/release/python-3130b1/ *This is a beta preview of

Re: Use of statement 'global' in scripts.

2024-05-08 Thread Popov, Dmitry Yu via Python-list
Thank you! From: Python-list on behalf of Greg Ewing via Python-list Sent: Wednesday, May 8, 2024 3:56 AM To: python-list@python.org Subject: Re: Use of statement 'global' in scripts. On 8/05/24 1: 32 pm, Popov, Dmitry Yu wrote: > The statement 'global',

Re: Use of statement 'global' in scripts.

2024-05-08 Thread Greg Ewing via Python-list
On 8/05/24 1:32 pm, Popov, Dmitry Yu wrote: The statement 'global', indicating variables living in the global scope, is very suitable to be used in modules. I'm wondering whether in scripts, running at the top-level invocation of the interpreter, statement 'global' is used exactly the same

Use of statement 'global' in scripts.

2024-05-07 Thread Popov, Dmitry Yu via Python-list
Dear Sirs. The statement 'global', indicating variables living in the global scope, is very suitable to be used in modules. I'm wondering whether in scripts, running at the top-level invocation of the interpreter, statement 'global' is used exactly the same way as in modules? If there are any

Re: Issues with uninstalling python versions on windows server

2024-05-07 Thread Tripura Seersha via Python-list
Hi Barry, Yes, the install was for specific user. As suggested by you, when I installed a version for all users, I was able to uninstall from the account used for automation successfully. Thank you for the help on this issue. However, for installation the account being used in automation has

Re: Python Dialogs

2024-05-06 Thread Chris Angelico via Python-list
On Tue, 7 May 2024 at 03:42, jak via Python-list wrote: > > Loris Bennett ha scritto: > > r...@zedat.fu-berlin.de (Stefan Ram) writes: > > > >>Me (indented by 2) and the chatbot (flush left). Lines lengths > 72! > > > > Is there a name for this kind of indentation, i.e. the stuff you are > >

Re: how to discover what values produced an exception?

2024-05-06 Thread Chris Angelico via Python-list
On Tue, 7 May 2024 at 03:38, Alan Bawden via Python-list wrote: > A good error message shouldn't withhold any information that can > _easily_ be included. Debugging is more art than science, so there is > no real way to predict what information might prove useful in solving > the crime. I

Re: Python Dialogs

2024-05-06 Thread jak via Python-list
Loris Bennett ha scritto: r...@zedat.fu-berlin.de (Stefan Ram) writes: Me (indented by 2) and the chatbot (flush left). Lines lengths > 72! Is there a name for this kind of indentation, i.e. the stuff you are writing not being flush left? It is sort of contrary to what I think of as

Re: Python Dialogs

2024-05-06 Thread jak via Python-list
Stefan Ram ha scritto: r...@zedat.fu-berlin.de (Stefan Ram) wrote or quoted: translation services are gonna interpret line breaks as I just beefed up my posting program to replace "gonna". Now I won't come across like some street thug, but rather as a respectable member of human

Re: how to discover what values produced an exception?

2024-05-06 Thread Left Right via Python-list
From a practical perspective: not all values are printable (especially if printing a value results in an error: then you'd lose the original error, so, going crazy with printing of errors is usually not such a hot idea). But, if you want the values: you'd have to examine the stack, extract the

Re: how to discover what values produced an exception?

2024-05-06 Thread Alan Bawden via Python-list
Thomas Passin writes: On 5/3/2024 9:56 AM, Johanne Fairchild via Python-list wrote: > How to discover what values produced an exception? Or perhaps---why > doesn't the Python traceback show the values involved in the TypeError? > For instance: > >

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: Python Dialogs

2024-05-04 Thread Peter J. Holzer via Python-list
On 2024-05-02 16:34:38 +0200, Loris Bennett via Python-list wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: > > Me (indented by 2) and the chatbot (flush left). Lines lengths > 72! > > Is there a name for this kind of indentation, i.e. the stuff you are > writing not being flush left?

Re: how to discover what values produced an exception?

2024-05-04 Thread Dan Sommers via Python-list
On 2024-05-03 at 10:56:39 -0300, Johanne Fairchild via Python-list wrote: > How to discover what values produced an exception? Or perhaps---why > doesn't the Python traceback show the values involved in the TypeError? > For instance: > >

Re: how to discover what values produced an exception?

2024-05-04 Thread Dieter Maurer via Python-list
Johanne Fairchild wrote at 2024-5-3 10:56 -0300: >How to discover what values produced an exception? Or perhaps---why >doesn't the Python traceback show the values involved in the TypeError? >For instance: > >--8<>8--- (0,0) < 4

Re: how to discover what values produced an exception?

2024-05-03 Thread Thomas Passin via Python-list
On 5/3/2024 9:56 AM, Johanne Fairchild via Python-list wrote: How to discover what values produced an exception? Or perhaps---why doesn't the Python traceback show the values involved in the TypeError? For instance: --8<>8--- (0,0) < 4

Re: Issues with uninstalling python versions on windows server

2024-05-03 Thread Barry via Python-list
> On 3 May 2024, at 17:43, 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

how to discover what values produced an exception?

2024-05-03 Thread Johanne Fairchild via Python-list
How to discover what values produced an exception? Or perhaps---why doesn't the Python traceback show the values involved in the TypeError? For instance: --8<>8--- >>> (0,0) < 4 Traceback (most recent call last): File "", line 1, in

Re: Python Dialogs (Posting On Python-List Prohibited)

2024-05-03 Thread Alan Bawden via Python-list
Lawrence D'Oliveiro writes: > Assume you have an expression "s.replace('a','b').replace('c','d'). > replace('e','f').replace('g','h')". Its value is a string which > is the value of s, but with "a" replaced by "b", "c" replaced by > "d", "e" replaced by "f" and "g" replaced by "h".

Re: Python Dialogs

2024-05-03 Thread Loris Bennett via Python-list
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Me (indented by 2) and the chatbot (flush left). Lines lengths > 72! Is there a name for this kind of indentation, i.e. the stuff you are writing not being flush left? It is sort of contrary to what I think of as "normal" indentation. You seem

Issues with uninstalling python versions on windows server

2024-05-03 Thread Tripura Seersha via Python-list
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 installed. But for automation, we are not aware which

Re: UTF_16 question

2024-05-01 Thread jak via Python-list
Richard Damon ha scritto: On Apr 29, 2024, at 12:23 PM, jak via Python-list wrote: Hi everyone, one thing that I do not understand is happening to me: I have some text files with different characteristics, among these there are that they have an UTF_32_le coding, utf_32be, utf_16_le,

Re: UTF_16 question

2024-04-29 Thread Richard Damon via Python-list
> On Apr 29, 2024, at 12:23 PM, jak via Python-list > wrote: > > Hi everyone, > one thing that I do not understand is happening to me: I have some text > files with different characteristics, among these there are that they > have an UTF_32_le coding, utf_32be, utf_16_le, utf_16_be all of them

Re: UTF_16 question

2024-04-29 Thread jak via Python-list
Stefan Ram ha scritto: jak wrote or quoted: I read it, both with encoding='utf_16_be' and with 'utf_16_le' without errors but in the last case the bytes are inverted. I think the order of the octets (bytes) is exactly the difference between these two encodings,

UTF_16 question

2024-04-29 Thread jak via Python-list
Hi everyone, one thing that I do not understand is happening to me: I have some text files with different characteristics, among these there are that they have an UTF_32_le coding, utf_32be, utf_16_le, utf_16_be all of them without BOM. With those utf_32_xx I have no problem but with the

Changing path to python in pip.exe, ipython.exe, etc

2024-04-25 Thread Olivier B. via Python-list
I am building a python work environment where - i build python from sources - install pip with the wheel bundled with python - then install things with pip, like Jupyter That environment is then deployed on various machines, at various installation folders. One issue I encounter, is the path

ANN: Python Meeting Düsseldorf - 17.04.2024

2024-04-16 Thread eGenix Team via Python-list
/This announcement is in German since it targets a local user group//meeting in Düsseldorf, Germany/ Ankündigung Python Meeting Düsseldorf - April 2024 Ein Treffen von Python Enthusiasten und

Re: help: pandas and 2d table

2024-04-16 Thread jak via Python-list
Stefan Ram ha scritto: jak wrote or quoted: Stefan Ram ha scritto: df = df.where( df == 'zz' ).stack().reset_index() result ={ 'zz': list( zip( df.iloc[ :, 0 ], df.iloc[ :, 1 ]))} Since I don't know Pandas, I will need a month at least to understand these 2 lines of code. Thanks again.

Re: help: pandas and 2d table

2024-04-16 Thread jak via Python-list
Stefan Ram ha scritto: df = df.where( df == 'zz' ).stack().reset_index() result ={ 'zz': list( zip( df.iloc[ :, 0 ], df.iloc[ :, 1 ]))} Since I don't know Pandas, I will need a month at least to understand these 2 lines of code. Thanks again. --

Custom importer and errors

2024-04-15 Thread Fabiano Sidler via Python-list
Hi folks! I'd like to split my package tree into several IDE projects and build a custom importer to import     'top.child1.child2' from the directory     /top.child1.child2/__init__.py so basically replacing the dots with slashes and having the package content lying directly in the project

Re: help: pandas and 2d table

2024-04-13 Thread Tim Williams via Python-list
On Sat, Apr 13, 2024 at 1:10 PM Mats Wichmann via Python-list < python-list@python.org> wrote: > On 4/13/24 07:00, jak via Python-list wrote: > > doesn't Pandas have a "where" method that can do this kind of thing? Or > doesn't it match what you are looking for? Pretty sure numpy does, but >

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: help: pandas and 2d table

2024-04-13 Thread jak via Python-list
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 open( 'file_20240412201813_tmp_DML.csv', 'w' )as

Re: How to Add ANSI Color to User Response

2024-04-13 Thread Pierre Fortin via Python-list
On Thu, 11 Apr 2024 05:00:32 +0200 Gisle Vanem via Python-list wrote: >Pierre Fortin wrote: > >> Over the years, I've tried different mechanisms for applying colors until >> I got my hands on f-stings; then I created a tiny module with all the >> colors (cR, cG, etc) which made my life so much

help: pandas and 2d table

2024-04-12 Thread jak via Python-list
Hi everyone. I state that I don't know anything about 'pandas' but I intuited that it could do what I want. I get, through the "read_excel" method, a table similar to this: obj| foo1 foo2 foo3 foo4 foo5 foo6 --- foo1| aa ab zz ad ae af

Re: How to Add ANSI Color to User Response

2024-04-12 Thread Gisle Vanem via Python-list
Pierre Fortin wrote: Over the years, I've tried different mechanisms for applying colors until I got my hands on f-stings; then I created a tiny module with all the colors (cR, cG, etc) which made my life so much simpler (attached). Attachments are stripped off in this list. It would be nice

Re: First two bytes of 'stdout' are lost

2024-04-11 Thread Cameron Simpson via Python-list
On 11Apr2024 14:42, Olivier B. wrote: I am trying to use StringIO to capture stdout, in code that looks like this: import sys from io import StringIO old_stdout = sys.stdout sys.stdout = mystdout = StringIO() print( "patate") mystdout.seek(0) sys.stdout = old_stdout print(mystdout.read())

Re: How to Add ANSI Color to User Response

2024-04-11 Thread Cameron Simpson via Python-list
On 10Apr2024 23:41, Alan Gauld wrote: Normally, for any kind of fancy terminal work, I'd say use curses. My problem with curses is that it takes over the whole terminal - you need to manage everything from that point on. Great if you want it (eg some full-terminal tool like `top`) but

Re: First two bytes of 'stdout' are lost

2024-04-11 Thread Thomas Passin via Python-list
On 4/11/2024 8:42 AM, Olivier B. via Python-list wrote: I am trying to use StringIO to capture stdout, in code that looks like this: import sys from io import StringIO old_stdout = sys.stdout sys.stdout = mystdout = StringIO() print( "patate") mystdout.seek(0) sys.stdout = old_stdout

Re: First two bytes of 'stdout' are lost

2024-04-11 Thread Olivier B. via Python-list
Partly answering myself: For some reason, right after mystdout has been created, i now have to do mystdout.seek(0) and this solves the issue. No idea why though.. Le jeu. 11 avr. 2024 à 14:42, Olivier B. a écrit : > > I am trying to use StringIO to capture stdout, in code that looks like this:

  1   2   3   4   5   6   7   8   9   10   >