Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-19 Thread c . buhtz
Dear Chris, thanks for asking back and my apologize for being to broad in my way of asking (in a foreign language). Am 19.12.2022 07:40 schrieb Chris Angelico: Hmm, then I'm not sure what you're *losing* here. The problem, as I understand it, is that the scripts are getting installed into /usr

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-19 Thread Chris Angelico
On Mon, 19 Dec 2022 at 19:38, wrote: > > Dear Chris, > thanks for asking back and my apologize for being to broad in my way of > asking (in a foreign language). > > Am 19.12.2022 07:40 schrieb Chris Angelico: > > Hmm, then I'm not sure what you're *losing* here. The problem, as I > > understand it

Re: Single line if statement with a continue

2022-12-19 Thread Peter J. Holzer
On 2022-12-18 16:49:27 +, Stefan Ram wrote: > Dennis Lee Bieber writes: > >>for idx, thing in enumerate(things): > >>if idx == 103: > >>continue > >>do_something_with(thing) > >> > > For this example, I'd probably reverse the condition. > > if idx != 103: > >

Re: String to Float, without introducing errors

2022-12-19 Thread Peter J. Holzer
On 2022-12-19 09:25:17 +1100, Chris Angelico wrote: > On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote: > > G = Decimal( 6.6743015E-11 ) > > r = Decimal( 6.371E6 ) > > M = Decimal( 5.9722E24 ) > > What's the point of using Decimal if you start with nothing more than > float accuracy? Right. He als

Re: Installation hell

2022-12-19 Thread Weatherby,Gerard
Personally, I don’t use Windows and avoid it like the plague. Python is easy to install on Linux and Mac. I’d start here: https://learn.microsoft.com/en-us/visualstudio/python/overview-of-python-tools-for-visual-studio?view=vs-2022 From: Python-list on behalf of Jim Lewis Date: Sunday, Dece

Re: String to Float, without introducing errors

2022-12-19 Thread Thomas Passin
On 12/19/2022 9:10 AM, Peter J. Holzer wrote: On 2022-12-19 09:25:17 +1100, Chris Angelico wrote: On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote: G = Decimal( 6.6743015E-11 ) r = Decimal( 6.371E6 ) M = Decimal( 5.9722E24 ) What's the point of using Decimal if you start with nothing more than

Re: String to Float, without introducing errors

2022-12-19 Thread MRAB
On 2022-12-19 14:10, Peter J. Holzer wrote: On 2022-12-19 09:25:17 +1100, Chris Angelico wrote: On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote: > G = Decimal( 6.6743015E-11 ) > r = Decimal( 6.371E6 ) > M = Decimal( 5.9722E24 ) What's the point of using Decimal if you start with nothing more th

Re: Installation hell

2022-12-19 Thread Thomas Passin
On 12/19/2022 9:59 AM, Weatherby,Gerard wrote: Personally, I don’t use Windows and avoid it like the plague. Python is easy to install on Linux and Mac. That's not been my experience. Windows installers for Python have worked well for me over many generations of Python releases. It's Linux

Re: String to Float, without introducing errors

2022-12-19 Thread Peter J. Holzer
On 2022-12-19 15:14:14 +, MRAB wrote: > On 2022-12-19 14:10, Peter J. Holzer wrote: > > He also interpreted the notation "6.67430(15)E-11" wrong. The > > digits in parentheses represent the uncertainty in the same number of > > last digits. So "6.67430(15)E-11" means "something between 6.67430E

Re: Installation hell

2022-12-19 Thread Chris Angelico
On Tue, 20 Dec 2022 at 03:05, Thomas Passin wrote: > > That's not been my experience. Windows installers for Python have > worked well for me over many generations of Python releases. It's Linux > where I've found difficulties. For example, if your distro's Python > install didn't include tkint

Re: Installation hell

2022-12-19 Thread Peter J. Holzer
On 2022-12-19 10:55:52 -0500, Thomas Passin wrote: > On 12/19/2022 9:59 AM, Weatherby,Gerard wrote: > > Personally, I don’t use Windows and avoid it like the plague. > > Python is easy to install on Linux and Mac. > > That's not been my experience. Windows installers for Python have worked > well

Re: Installation hell

2022-12-19 Thread Thomas Passin
On 12/19/2022 11:36 AM, Chris Angelico wrote: On Tue, 20 Dec 2022 at 03:05, Thomas Passin wrote: That's not been my experience. Windows installers for Python have worked well for me over many generations of Python releases. It's Linux where I've found difficulties. For example, if your dist

Re: Installation hell

2022-12-19 Thread Chris Angelico
On Tue, 20 Dec 2022 at 03:56, Peter J. Holzer wrote: > > It is however, quite noticable that almost everyone who asks a question > about their Python installation on this list is using Windows. I don't > think this is just because there are more Windows users than Linux or > Mac Users. Yes. I thi

Re: Installation hell

2022-12-19 Thread Chris Angelico
On Tue, 20 Dec 2022 at 04:14, Thomas Passin wrote: > > On 12/19/2022 11:36 AM, Chris Angelico wrote: > > On Tue, 20 Dec 2022 at 03:05, Thomas Passin wrote: > >> > >> That's not been my experience. Windows installers for Python have > >> worked well for me over many generations of Python releases

Re: Fwd: Installation hell

2022-12-19 Thread j via Python-list
I agree. Wasted too much time on last few installs. It got to the point I downloaded python-embedded, unzipped it and set the path manually for my work (needed it as part of a compiler). It ain't good enough. And I like python. jan On 18/12/2022 11:50, Jim Lewis wrote: I'm an occasional use

Re: Fwd: Installation hell

2022-12-19 Thread Thomas Passin
On 12/19/2022 12:28 PM, j via Python-list wrote: I agree. Wasted too much time on last few installs. It got to the point I downloaded python-embedded, unzipped it and set the path manually for my work (needed it as part of a compiler). I don't set those paths. If you have several different v

Re: Keeping a list of records with named fields that can be updated

2022-12-19 Thread Peter Otten
On 17/12/2022 20:45, Albert-Jan Roskam wrote: On Dec 15, 2022 10:21, Peter Otten <__pete...@web.de> wrote: >>> from collections import namedtuple >>> Row = namedtuple("Row", "foo bar baz") >>> row = Row(1, 2, 3) >>> row._replace(bar=42) Row(foo=1, bar=42, baz=3)

Re: Installation hell

2022-12-19 Thread Peter J. Holzer
On 2022-12-20 04:15:07 +1100, Chris Angelico wrote: > On Tue, 20 Dec 2022 at 03:56, Peter J. Holzer wrote: > > It is however, quite noticable that almost everyone who asks a question > > about their Python installation on this list is using Windows. I don't > > think this is just because there are

Re: String to Float, without introducing errors

2022-12-19 Thread Greg Ewing
On 19/12/22 9:24 am, Stefan Ram wrote: So what's the time until a mass of one gram arrives at the ground versus a mass of ten grams? I think one needs "Decimal" to calculate this! Or you can be smarter about how you calculate it. Differentiating t with respect to m gives dt/dm = -0.5 * sqr

Re: String to Float, without introducing errors

2022-12-19 Thread Sabrina Almodóvar
On 17/12/2022 18:55, Stefan Ram wrote: > Grant Edwards writes: >> Yes, fixed point (or decimal) is a better fit for what he's doing. but >> I suspect that floating point would be a better fit for the problem >> he's trying to solve. > > I'd like to predict that within the next ten posts in this

Re: String to Float, without introducing errors

2022-12-19 Thread Michael F. Stemper
On 19/12/2022 09.14, MRAB wrote: On 2022-12-19 14:10, Peter J. Holzer wrote: On 2022-12-19 09:25:17 +1100, Chris Angelico wrote: On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote: > G = Decimal( 6.6743015E-11 ) > r = Decimal( 6.371E6 ) > M = Decimal( 5.9722E24 ) What's the point of using Decimal

Re: Keeping a list of records with named fields that can be updated

2022-12-19 Thread Peter Otten
On 18/12/2022 16:44, songbird wrote: Peter Otten wrote: ... While I think what you need is a database instead of the collection of csv files the way to alter namedtuples is to create a new one: from collections import namedtuple Row = namedtuple("Row", "foo bar baz") row = Row(1, 2, 3) row._r

Re: Fwd: Installation hell

2022-12-19 Thread DFS
On 12/18/2022 6:50 AM, Jim Lewis wrote: I'm an occasional user of Python and have a degree in computer science. Almost every freaking time I use Python, I go through PSH (Python Setup Hell). Sometimes a wrong version is installed. Sometimes it's a path issue. Or exe naming confusion: python, pyth

Re: String to Float, without introducing errors

2022-12-19 Thread Ángel GR
On 2022-12-19 16:14, MRAB wrote: To be fair, I don't think I've never seen that notation either! I've only ever seen the form 6.67430E-11 ± 0.00015E-11, which is much clearer. We use it regularly in our experimental data: 6.3(4), 15.002(10). Things would become complex using exponential forms

Re: Keeping a list of records with named fields that can be updated

2022-12-19 Thread songbird
Peter Otten wrote: ... > I recommend that you use a dataclass /instead/ of a namedtuple, not > both. However, for a dataclass with the same fields in the same order as > in your namedtuple the conversion is trivial: > > Create compatible namedtuple and dataclass types: > > >>> NTRow = namedtuple("N

RE: Fwd: Installation hell

2022-12-19 Thread Jim Schwartz
This type of response is not called for. I thought this list was designed to help people. That's not what this person was doing. Everyone has different experience levels and backgrounds. Help them learn. Don't berate them. Here's what was said: Issues installing python and sending an email?

Re: Fwd: Installation hell

2022-12-19 Thread j via Python-list
I was unclear. I use the full path to the folder with the unzipped python-embedded. I shouldn't have said 'set'. I have complained on here before about broken installs but got indifference. An installer should install stuff correctly (leaving a working environment). If it won't then give clear

Re: Fwd: Installation hell

2022-12-19 Thread Mats Wichmann
On 12/19/22 13:34, j via Python-list wrote: I was unclear. I use the full path to the folder with the unzipped python-embedded. I shouldn't have said 'set'. I have complained on here before about broken installs but got indifference. An installer should install stuff correctly (leaving a work

Re: Installation hell

2022-12-19 Thread Weatherby,Gerard
I was suggesting a possible resource while making it clear I am not Windows savvy. My avoidance of Windows has nothing to do with Python, so there is no need to discuss it here. If I don’t care which Python I’m using, I’ll type python3. If I want3.9, python3.9. python3 -V tells me the default

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Mark Bourne
Jach Feng wrote: I have a script using the argparse module. I want to enter the string "step\x0A" as one of its positional arguments. I expect this string has a length of 5, but it gives 8. Obviously the escape character didn't function correctly. How to do it? That depends on the command-li

Re: Installation hell

2022-12-19 Thread Eryk Sun
On 12/18/22, Jim Lewis wrote: > > Sometimes it's a path issue. For whatever reason, Python installations on Windows lack versioned executable names (except for the Microsoft Store distribution). Thus adding multiple installations to PATH doesn't help unless "python.exe" is manually linked or copi

Re: Fwd: Installation hell

2022-12-19 Thread Thomas Passin
On 12/19/2022 3:34 PM, j wrote: I was unclear. I use the full path to the folder with the unzipped python-embedded. I shouldn't have said 'set'. I have complained on here before about broken installs but got indifference. An installer should install stuff correctly (leaving a working environm

Re: Fwd: Installation hell

2022-12-19 Thread Thomas Passin
On 12/19/2022 4:54 PM, Thomas Passin wrote: On 12/19/2022 3:34 PM, j wrote: I was unclear. I use the full path to the folder with the unzipped python-embedded. I shouldn't have said 'set'. I have complained on here before about broken installs but got indifference. An installer should install

Re: Fwd: Installation hell

2022-12-19 Thread Chris Angelico
On Tue, 20 Dec 2022 at 09:12, Thomas Passin wrote: > FWIW, I once set up a Python installation so that it could run from a > USB stick (Windows only). My launcher was a batch file that contained > the following: > > @echo off > setlocal > : Find effective drive for this file. > set ed=%~d0 > path

Re: Installation hell

2022-12-19 Thread Mats Wichmann
On 12/19/22 14:47, Eryk Sun wrote: If you search a bit deeper, you'll find a site with unofficial Windows builds of many packages, including pygame for Python 3.11: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame Semi-OT: that's been a superb resource, but apparently it's no longer maintain

Re: Fwd: Installation hell

2022-12-19 Thread Thomas Passin
On 12/19/2022 5:16 PM, Chris Angelico wrote: On Tue, 20 Dec 2022 at 09:12, Thomas Passin wrote: FWIW, I once set up a Python installation so that it could run from a USB stick (Windows only). My launcher was a batch file that contained the following: @echo off setlocal : Find effective drive

Re: Fwd: Installation hell

2022-12-19 Thread Grant Edwards
On 2022-12-19, Chris Angelico wrote: > So much easier to do on a Unix-like system, where you don't need to > concern yourself with "effective drive" and can simply use relative > paths. I know we're not here to bash Windows, but... drive letters > really need to just die already. They needed to

Re: Fwd: Installation hell

2022-12-19 Thread Chris Angelico
On Tue, 20 Dec 2022 at 10:01, Thomas Passin wrote: > > On 12/19/2022 5:16 PM, Chris Angelico wrote: > > On Tue, 20 Dec 2022 at 09:12, Thomas Passin wrote: > >> FWIW, I once set up a Python installation so that it could run from a > >> USB stick (Windows only). My launcher was a batch file that c

OT: ~gohlke [Was: Installation hell]

2022-12-19 Thread Mike Dewhirst
On 20/12/2022 9:28 am, Mats Wichmann wrote: On 12/19/22 14:47, Eryk Sun wrote: If you search a bit deeper, you'll find a site with unofficial Windows builds of many packages, including pygame for Python 3.11: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame Semi-OT: that's been a superb reso

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Jach Feng
Mark Bourne 在 2022年12月20日 星期二凌晨4:49:13 [UTC+8] 的信中寫道: > Jach Feng wrote: > > I have a script using the argparse module. I want to enter the string > > "step\x0A" as one of its positional arguments. I expect this string has a > > length of 5, but it gives 8. Obviously the escape character didn't

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Thomas Passin
On 12/19/2022 9:24 PM, Jach Feng wrote: Mark Bourne 在 2022年12月20日 星期二凌晨4:49:13 [UTC+8] 的信中寫道: Jach Feng wrote: I have a script using the argparse module. I want to enter the string "step\x0A" as one of its positional arguments. I expect this string has a length of 5, but it gives 8. Obviously

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Eryk Sun
On 12/19/22, Jach Feng wrote: > > That's really good for Linux user! How about Windows? In CMD, typing the "^" escape character at the end of a line ignores the newline and prompts for "more" input. If you press enter again, you'll get another "more" prompt in which you can write the rest of the