Re: Namespaces: memory vs 'pollution'

2019-07-21 Thread DL Neil
On 22/07/19 5:30 AM, Roel Schroeven wrote: DL Neil schreef op 21/07/2019 om 2:02: How do you remember to from-import- 'everything' that is needed? ... > Upon closer inspection, I realised it didn't just fail; it failed badly! Some silly, little, boy had imported the PythonEnvironment class but

Re: Proper shebang for python3

2019-07-21 Thread Cameron Simpson
On 21Jul2019 15:47, Peter J. Holzer wrote: On 2019-07-21 09:04:43 +1000, Cameron Simpson wrote: I'm with Tim Daneliuk. The environment matters and should be honoured except in extremely weird cases. I don't think that all the scripts in /usr/bin are extremely weird cases. I think I'd bette

Re: How to print out html tags excluding the attributes

2019-07-21 Thread Michael F. Stemper
On 20/07/2019 20.04, sum abiut wrote: > I want to use regular expression to print out the HTML tags excluding the > attributes. > > for example: > > import re > html = 'Hitest test' > tags = re.findall(r'<[^>]+>', html) > for a in tags: > print(a) > > > the output is : > > > > > > >

Re: Counting Python threads vs C/C++ threads

2019-07-21 Thread Peter J. Holzer
On 2019-07-16 12:48:33 -0700, Dan Stromberg wrote: > On Tue, Jul 16, 2019 at 11:13 AM Barry Scott wrote: > > Does top show the process using 100% CPU? > > > Nope. CPU utilization and disk use are both low. > > We've been going into top, and then hitting '1' to see things broken down > by CPU cor

Re: Namespaces: memory vs 'pollution'

2019-07-21 Thread Roel Schroeven
DL Neil schreef op 21/07/2019 om 2:02: How do you remember to from-import- 'everything' that is needed? ... > Upon closer inspection, I realised it didn't just fail; it failed badly! Some silly, little, boy had imported the PythonEnvironment class but failed to ALSO import PythonVersionError. So,

Re: Proper shebang for python3

2019-07-21 Thread Peter J. Holzer
On 2019-07-21 10:26:17 -0500, Tim Daneliuk wrote: > On 7/21/19 8:47 AM, Peter J. Holzer wrote: > > That's fine. Unlike Tim I don't claim that anybody who disagrees with me > > must be a newbie. > > Peter, that's ad hominem and unfair. No, it isn't. Please read the first paragraph of https://en.wi

Re: Proper shebang for python3

2019-07-21 Thread Chris Angelico
On Mon, Jul 22, 2019 at 1:36 AM Tim Daneliuk wrote: > > On 7/21/19 8:47 AM, Peter J. Holzer wrote: > > That's fine. Unlike Tim I don't claim that anybody who disagrees with me > > must be a newbie. > > Peter, that's ad hominem and unfair. I never said anything close to that. > What I said is that

Re: Proper shebang for python3

2019-07-21 Thread Tim Daneliuk
On 7/21/19 8:47 AM, Peter J. Holzer wrote: > That's fine. Unlike Tim I don't claim that anybody who disagrees with me > must be a newbie. Peter, that's ad hominem and unfair. I never said anything close to that. What I said is that if someone were to spend an extended period of time in devops and

Re: Namespaces: memory vs 'pollution'

2019-07-21 Thread Peter J. Holzer
On 2019-07-21 12:02:27 +1200, DL Neil wrote: > What do you do to (respecting purism) ensure 'everything' (necessary) is > imported (and nothing more), preferably without relying upon (faulty, in my > case) human-memory or reading through volumes of code/documentation? I write tests (not as consist

Re: Proper shebang for python3

2019-07-21 Thread Peter J. Holzer
On 2019-07-21 09:04:43 +1000, Cameron Simpson wrote: > On 21Jul2019 08:14, Chris Angelico wrote: > > On Sun, Jul 21, 2019 at 5:26 AM Tim Daneliuk wrote: > > > So, no, do NOT encode the hard location - ever. Always use env to > > > discover the one that the user has specified. The only exception

Re: Proper shebang for python3

2019-07-21 Thread Peter J. Holzer
On 2019-07-20 15:26:46 -0500, Tim Daneliuk wrote: > On 7/20/19 2:56 PM, Peter J. Holzer wrote: > > On 2019-07-20 14:11:44 -0500, Tim Daneliuk wrote: > >> So, no, do NOT encode the hard location - ever. Always use env to > >> discover the one that the user has specified. The only exception is > >>

Re: Proper shebang for python3

2019-07-21 Thread eryk sun
On 7/20/19, Michael Speer wrote: > > You may want to use `#!/usr/bin/env python3` instead. This is partially supported in Windows, but only if .py files are associated with the py.exe launcher and the shebang runs "python" instead of "python3". py.exe supports four builtin virtual commands: "/us

Re: Proper shebang for python3

2019-07-21 Thread Brian Oney via Python-list
On July 21, 2019 10:04:47 AM GMT+02:00, Manfred Lotz wrote: >On Sun, 21 Jul 2019 10:21:55 +1000 >Cameron Simpson wrote: > >> On 21Jul2019 09:31, Chris Angelico wrote: >> >On Sun, Jul 21, 2019 at 9:15 AM Cameron Simpson >> >wrote: So you mean that a tool that depends on running on a >> >c

Re: Proper shebang for python3

2019-07-21 Thread Manfred Lotz
On Sun, 21 Jul 2019 10:21:55 +1000 Cameron Simpson wrote: > On 21Jul2019 09:31, Chris Angelico wrote: > >On Sun, Jul 21, 2019 at 9:15 AM Cameron Simpson > >wrote: So you mean that a tool that depends on running on a > >consistent environment, it should use a shebang of > >"/usr/bin/python3.

Re: Proper shebang for python3

2019-07-21 Thread Barry Scott
> On 21 Jul 2019, at 08:29, Christian Gollwitzer wrote: > > Am 21.07.19 um 07:31 schrieb Tim Daneliuk: >> On 7/20/19 6:04 PM, Chris Angelico wrote: >>> Are you aware of every systemwide command that happens to be >>> implemented in Python, such that you won't execute any of them while >>> you

Re: Proper shebang for python3

2019-07-21 Thread Christian Gollwitzer
Am 21.07.19 um 07:31 schrieb Tim Daneliuk: On 7/20/19 6:04 PM, Chris Angelico wrote: Are you aware of every systemwide command that happens to be implemented in Python, such that you won't execute any of them while you have the venv active? No, but this has never been a problem because the new