Re: python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via Python-list
I see the literal 'escape' character + 'k', when it should let me edit previous commands. I did have to compile my own python because I'm using 2.7 on this machine. I figured it out. I needed to apt install libreadline-dev. -- https://mail.python.org/mailman/listinfo/python-list

Re: python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via Python-list
For this to work, the Python implementation should use the same readline library as your shell, I guess. It works in python3, so I guess my problem is that I'm compiling python (I think kubuntu dropped python2), but I don't see any relevant options in the configure help. -- https://m

python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via Python-list
Kubuntu 24.04. sinewave:toby ~(1)> cat .inputrc set editing-mode vi set keymap vi sinewave:toby ~(1)> cat .editrc bind -v bind \\t rl_complete sinewave:toby ~(1)> python Python 2.7.18 (default, Jul 8 2024, 12:49:12) [GCC 13.2.0] on linux2 Type "help", "copyright", "credits" or "license" for mor

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

2024-01-23 Thread Sibylle Koczian via Python-list
Am 17.01.2024 um 19:44 schrieb Mats Wichmann via Python-list: Be interesting to know if your WIndows 10 has those files in place, and it's just a missing path entry (a good thing, perhaps) that's causing it not to be found there. Yes. Python is not on the Path - by design. while the new Wi

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

2024-01-23 Thread Sibylle Koczian via Python-list
er seeing these settings on my "old" computer, but it seems I turned them off six years ago and completely forgot about them. Or could that have been an older default? "python" or "python3" in the shebang line doesn't seem to make a difference, at least not on mac

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 pytho

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

2024-01-16 Thread Barry via Python-list
> On 16 Jan 2024, at 17:11, Sibylle Koczian via Python-list > wrote: > > while the new Windows 11 machine finds the Microsoft stub You can turn off the stub in windows settings. The magic windows jargon is “App Execution Aliases”. Once you find it in settings you can turn off the python and p

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

2024-01-16 Thread Sibylle Koczian via Python-list
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 python.org: yes. this question is about the python.org distri

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

2024-01-15 Thread Thomas Passin via Python-list
On 1/15/2024 7:24 PM, Thomas Passin wrote: On 1/15/2024 6:27 PM, Greg Ewing via Python-list wrote: On 16/01/24 11:55 am, Mats Wichmann wrote: Windows natively has something called python.exe and python3.exe which is interfering here I'm wondering whether py.exe should be taught to recognise t

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

2024-01-15 Thread Thomas Passin via Python-list
On 1/15/2024 6:27 PM, Greg Ewing via Python-list wrote: On 16/01/24 11:55 am, Mats Wichmann wrote: Windows natively has something called python.exe and python3.exe which is interfering here I'm wondering whether py.exe should be taught to recognise these stubs and ignore them. This sounds like

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

2024-01-15 Thread Greg Ewing via Python-list
On 16/01/24 11:55 am, Mats Wichmann wrote: Windows natively has something called python.exe and python3.exe which is interfering here I'm wondering whether py.exe should be taught to recognise these stubs and ignore them. This sounds like something that could trip a lot of people up. -- Greg

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"

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

2024-01-15 Thread Thomas Passin via Python-list
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 shebang line work as expected on a computer with

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 a

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

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

2024-01-15 Thread Sibylle Koczian via Python-list
use I didn't trust it believing it was a new-fangled Microsoft trick. I did read that PEP but it has no relevance for my mixed Windows/Linux environments. On reflection I now believe I won't use py.exe because it introduces an unnecessary layer of indirection.The  bottom line is that yo

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

2024-01-14 Thread Mike Dewhirst via Python-list
t trick. I did read that PEP but it has no relevance for my mixed Windows/Linux environments. On reflection I now believe I won't use py.exe because it introduces an unnecessary layer of indirection.The  bottom line is that you still need to know which Python a particular set of circumstan

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

2024-01-14 Thread Thomas Passin via Python-list
ng of PATH has changed. My Python isn't on the path, perhaps that is it. A shebang line without "/env" doesn't check the path, right? From what I've read recently, if you have a Python program that starts with a shebang line with any of four standard unix-like paths

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

2024-01-14 Thread Thomas Passin via Python-list
? No to both. I've tried with and without a py.ini and cannot duplicate what you see. It really seems strange. Only thing I can think of - and I don't really believe in that idea: as far as I know in Windows 11 the handling of PATH has changed. My Python isn't on the path,

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

2024-01-14 Thread Sibylle Koczian via Python-list
t duplicate what you see. It really seems strange. Only thing I can think of - and I don't really believe in that idea: as far as I know in Windows 11 the handling of PATH has changed. My Python isn't on the path, perhaps that is it. A shebang line without "/env" doesn

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

2024-01-09 Thread Barry Scott via Python-list
> On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list > wrote: > > Oh, and the two Windows and Python versions are on two different computers. > > Will remove the "/env" from my shebang lines, even if I don't understand > what's happening. Thanks for the details. Only thing I can thi

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

2024-01-07 Thread Sibylle Koczian via Python-list
Am 01.01.2024 um 12:50 schrieb Barry via Python-list: On 1 Jan 2024, at 11:14, Sibylle Koczian via Python-list wrote: But in all this thread I didn't see a single explanation for my current situation: one and the same shebang line works on Windows 10 / Python 3.11 and doesn'

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

2024-01-03 Thread Barry Scott via Python-list
> On 2 Jan 2024, at 17:24, Thomas Passin via Python-list > wrote: > > You might learn about this if you happen to read and remember the right part > of the Python docs. Otherwise you have no idea what py.exe is up to nor how > it does it. I would say that most people don't know there's an

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

2024-01-02 Thread Thomas Passin via Python-list
On 1/2/2024 11:56 AM, Mats Wichmann via Python-list wrote: 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, yo

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 launche

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

2024-01-01 Thread Thomas Passin via Python-list
py" launcher will be used but in actual fact the old Python 3.9.9 is used instead, as I wrote earlier. This is verified by this tiny Python script: # Optional shebang line here import sys print(sys.executable) Then run it with "py", a proposed shebang line, its plain name on the

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 i

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
a single explanation for my current situation: one and the same shebang line works on Windows 10 / Python 3.11 and doesn't work on Windows 11 / Python 3.12. I suspect Windows, because a change in the way Python 3.12 uses shebang lines should be visible in the documentation. The sheb

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

2024-01-01 Thread Thomas Passin via Python-list
ssible download source. But in all this thread I didn't see a single explanation for my current situation: one and the same shebang line works on Windows 10 / Python 3.11 and doesn't work on Windows 11 / Python 3.12. I suspect Windows, because a change in the way Python 3.12 uses shebang li

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

2024-01-01 Thread Thomas Passin via Python-list
't see a single explanation for my current situation: one and the same shebang line works on Windows 10 / Python 3.11 and doesn't work on Windows 11 / Python 3.12. I suspect Windows, because a change in the way Python 3.12 uses shebang lines should be visible in the documentation. Happy

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

2024-01-01 Thread Barry via Python-list
> On 1 Jan 2024, at 11:14, Sibylle Koczian via Python-list > wrote: > > But in all this thread I didn't see a single explanation for my current > situation: one and the same shebang line works on Windows 10 / Python 3.11 > and doesn't work on Windows 11 / Py

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

2024-01-01 Thread Sibylle Koczian via Python-list
uage there was no Python from any Microsoft shop (I'm not sure there was a Microsoft shop, it was in the last millenium, Python 1.5 or 1.6). So I tend to forget that possible download source. But in all this thread I didn't see a single explanation for my current situation: one and t

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

2023-12-29 Thread Chris Angelico via Python-list
On Sat, 30 Dec 2023 at 14:06, Mike Dewhirst via Python-list wrote: > > On 29/12/2023 12:09 pm, Félix An via Python-list wrote: > > On 2023-12-25 12:36, Mike Dewhirst wrote: > >> > >> 3. You cannot trust Microsoft. You can trust Python Software > >> Foundation. Python from PSF works the same in all

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

2023-12-29 Thread Mike Dewhirst via Python-list
On 29/12/2023 12:09 pm, Félix An via Python-list wrote: On 2023-12-25 12:36, Mike Dewhirst wrote: 3. You cannot trust Microsoft. You can trust Python Software Foundation. Python from PSF works the same in all environments - or if not it is a bug. Python from Microsoft is tweaked to satisfy th

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

2023-12-28 Thread Chris Angelico via Python-list
On Fri, 29 Dec 2023 at 12:23, Félix An via Python-list wrote: > > On 2023-12-25 12:36, Mike Dewhirst wrote: > > > > 3. You cannot trust Microsoft. You can trust Python Software Foundation. > > Python from PSF works the same in all environments - or if not it is a bug. > > Python from Microsoft i

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

2023-12-28 Thread Félix An via Python-list
On 2023-12-25 12:36, Mike Dewhirst wrote: 3. You cannot trust Microsoft. You can trust Python Software Foundation. Python from PSF works the same in all environments - or if not it is a bug. Python from Microsoft is tweaked to satisfy their aforementioned strategy of locking in users to Windo

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

2023-12-25 Thread Mike Dewhirst via Python-list
ython-list Subject: Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more On Mon, 25 Dec 2023 at 15:42, Mike Dewhirst via Python-list wrote:>> Apologies for top posting - my phone seems unable to do otherwise.>> Here's my view - which

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

2023-12-25 Thread rbowman via Python-list
On Sun, 24 Dec 2023 22:55:34 +, Barry wrote: >> On 24 Dec 2023, at 00:54, rbowman via Python-list >> wrote: >> >> Does that work with virtualenv or conda? I'm slowly getting up to speed >> with those. > > Conda is its own thing, not need for py.exe. > > Once you have created the venv you d

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

2023-12-24 Thread Chris Angelico via Python-list
On Mon, 25 Dec 2023 at 15:42, Mike Dewhirst via Python-list wrote: > > Apologies for top posting - my phone seems unable to do otherwise. > > Here's my view - which may not be popular. You're right about that part, anyhow :) > 4. Shebang lines are pretty much redundant now that most python inter

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

2023-12-24 Thread Mike Dewhirst via Python-list
to type the interpreter location before typing your script name. You must know your interpreter location to get the shebang line right. Shebangs were never intended as primary devices. They are linux/unix things. 5. Shebangs on Windows are a new opportunity for Microsoft to plough its own fur

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

2023-12-24 Thread Barry via Python-list
> On 24 Dec 2023, at 00:54, rbowman via Python-list > wrote: > > Does that work with virtualenv or conda? I'm slowly getting up to speed > with those. Conda is its own thing, not need for py.exe. Once you have created the venv you do not need py.exe as you will have pythob.exe in the venv

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

2023-12-23 Thread Michael Torrie via Python-list
hould, according to your shebang, just like on Unix. > > Does that work with virtualenv or conda? I'm slowly getting up to speed > with those. I don't know. I imagine py is aware of venv if you run it from the command line within the activated venv. But I doubt it is if you

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

2023-12-23 Thread rbowman via Python-list
On Fri, 22 Dec 2023 17:27:58 -0700, Michael Torrie wrote: > Using the py launcher as your Windows association with .py and.pyw files > you can have multiple versions of python installed and everything works > as it should, according to your shebang, just like on Unix. Does that work with virtuale

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

2023-12-23 Thread Michael Torrie via Python-list
On 12/22/23 20:56, Thomas Passin via Python-list wrote: > It's just better not to make assumptions about which version of Python > will be running. Just specify it yourself when you can, and then you can > be sure. Precisely, which is why the shebang is so useful, even on Windows with py launche

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

2023-12-23 Thread Barry Scott via Python-list
> On 23 Dec 2023, at 03:01, Thomas Passin via Python-list > wrote: > > Not on my system. It may depend on whether Python gets installed to Program > Files or to %USERPROFILE%/AppData/Local/Programs/Python. Python 3.9 is the > last verson I installed to Program Files, and that's the version

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

2023-12-23 Thread Peter J. Holzer via Python-list
On 2023-12-22 22:56:45 -0500, Thomas Passin via Python-list wrote: > In my experience one should always make sure to know what version of Python > is being used, at least if there is more than one version installed on the > computer. Even on Linux using a shebang line can be tricky, be

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

2023-12-22 Thread Thomas Passin via Python-list
On 12/22/2023 7:27 PM, Michael Torrie via Python-list wrote: On 12/22/23 07:02, Thomas Passin via Python-list wrote: On my Windows 10 machine, Python scripts run without a shebang line. Perhaps Windows 11 has added the ability to use one, but then you would need to use the actual location of

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

2023-12-22 Thread Thomas Passin via Python-list
On 12/22/2023 7:19 PM, Barry wrote: On 23 Dec 2023, at 00:15, Thomas Passin via Python-list wrote: In neither case is the shebang line used. As i understand it, not in front of my windows box to check. The handler for .py file extension is set to be the py.exe It is py.exe that

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

2023-12-22 Thread Michael Torrie via Python-list
On 12/22/23 07:02, Thomas Passin via Python-list wrote: > On my Windows 10 machine, Python scripts run without a shebang line. > Perhaps Windows 11 has added the ability to use one, but then you would > need to use the actual location of your Python executable. Yes if you associate .p

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

2023-12-22 Thread Michael Torrie via Python-list
On 12/22/23 11:42, Thomas Passin via Python-list wrote: > There is some important context that is missing here. Python on Windows > does not normally install to that location. That is not even a Windows > path, neither by directory name nor by path separators. No, that's just the way the py la

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

2023-12-22 Thread Barry via Python-list
> On 23 Dec 2023, at 00:15, Thomas Passin via Python-list > wrote: > > In neither case is the shebang line used. As i understand it, not in front of my windows box to check. The handler for .py file extension is set to be the py.exe It is py.exe that understands shebang l

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

2023-12-22 Thread Thomas Passin via Python-list
users, - the Python Launcher is installed for all users, - the file types .py, .pyw etc. are associated with Python. My shebang line is usually "#!/usr/bin/env python3". This has always worked well. I could run Python scripts in a console window entering just the script name, by double click

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

2023-12-22 Thread Thomas Passin via Python-list
. My shebang line is usually "#!/usr/bin/env python3". This has always worked well. I could run Python scripts in a console window entering just the script name, by double clicking in the explorer or using WIN+r; the two last variants for GUI or for scripts with something like "in

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

2023-12-22 Thread Barry via Python-list
> On 22 Dec 2023, at 14:58, Christian Buhtz via Python-list > wrote: > > On Windows 11 it usually is the "Terminal" which is different from cmd.exe. In terminal app you can run cmd.exe or powershell, so it is basically the same. Barry -- https://mail.python.org/mailman/listinfo/python-li

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

2023-12-22 Thread Barry via Python-list
> On 22 Dec 2023, at 14:29, Sibylle Koczian wrote: > > #!/usr/bin/env/python That was what i thought you had and it will not work. The BOM suggestion is worth trying. Barry -- https://mail.python.org/mailman/listinfo/python-list

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

2023-12-22 Thread Christian Buhtz via Python-list
What is the "command line" on your Windows 11? On Windows 10 it usually is "cmd.exe" (Windows Command Prompt). On Windows 11 it usually is the "Terminal" which is different from cmd.exe. -- https://mail.python.org/mailman/listinfo/python-list

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

2023-12-22 Thread J.O. Aho via Python-list
On 22/12/2023 13.36, Sibylle Koczian wrote: Hello, I always install Python on Windows in the same manner: - Python is not on the path, - it is installed for all users, - the Python Launcher is installed for all users, - the file types .py, .pyw etc. are associated with Python. My shebang line

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

2023-12-22 Thread Sibylle Koczian via Python-list
types .py, .pyw etc. are associated with Python. My shebang line is usually "#!/usr/bin/env python3". This has always worked well. I could run Python scripts in a console window entering just the script name, by double clicking in the explorer or using WIN+r; the two last variants for

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

2023-12-22 Thread Barry via Python-list
, > - the file types .py, .pyw etc. are associated with Python. > > My shebang line is usually "#!/usr/bin/env python3". > > This has always worked well. I could run Python scripts in a console > window entering just the script name, by double clicking in the explorer >

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

2023-12-22 Thread Sibylle Koczian via Python-list
Hello, I always install Python on Windows in the same manner: - Python is not on the path, - it is installed for all users, - the Python Launcher is installed for all users, - the file types .py, .pyw etc. are associated with Python. My shebang line is usually "#!/usr/bin/env python3&qu

Re: Line continuation and comments

2023-02-27 Thread Robert Latest via Python-list
Robert Latest wrote: > Paul Bryan wrote: >> Adding to this, there should be no reason now in recent versions of >> Python to ever use line continuation. Black goes so far as to state >> "backslashes are bad and should never be used": >> >

Re: Line continuation and comments

2023-02-27 Thread Robert Latest via Python-list
Paul Bryan wrote: > Adding to this, there should be no reason now in recent versions of > Python to ever use line continuation. Black goes so far as to state > "backslashes are bad and should never be used": > > https://black.readthedocs.io/en/stable/the_black_code_style/

Re: Line continuation and comments

2023-02-27 Thread Robert Latest via Python-list
lines and breaking them with the "\" line continuation character. In this >> context it would have been nice to be able to add comments to lines terms >> which of course isn't possible because the backslash must be the last >> character on the line. >> &

Re: Line continuation and comments

2023-02-24 Thread dn via Python-list
On 25/02/2023 10.04, Mark Bourne wrote: Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line.  I find it makes it more difficult to see wher

Re: Line continuation and comments

2023-02-24 Thread Roel Schroeven
Mark Bourne schreef op 24/02/2023 om 22:04: Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line. I find it makes it more difficult to see wher

Re: Line continuation and comments

2023-02-24 Thread Mark Bourne
Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line. I find it makes it more difficult to see where the scope of the class/method/etc. act

Re: Line continuation and comments

2023-02-23 Thread Cameron Simpson
On 24/02/2023 12.45, Weatherby,Gerard wrote: NB my PyCharm-settings grumble whenever I create an identifier which is only used once (and perhaps, soon after it was established). I understand the (space) optimisation, but prefer to trade that for 'readability'. It isn't "space". Got an example

RE: Line continuation and comments

2023-02-23 Thread avi.e.gross
ld react if you used: self.LEGAL_AGE_US = 21 -Original Message- From: Python-list On Behalf Of dn via Python-list Sent: Thursday, February 23, 2023 9:01 PM To: python-list@python.org Subject: Re: Line continuation and comments On 24/02/2023 12.45, Weatherby,Gerard wrote: > “ > NB my PyCharm-s

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
On 24/02/2023 12.45, Weatherby,Gerard wrote: “ NB my PyCharm-settings grumble whenever I create an identifier which is only used once (and perhaps, soon after it was established). I understand the (space) optimisation, but prefer to trade that for 'readability'. “ I haven’t seen that one. What I

Re: Line continuation and comments

2023-02-23 Thread Weatherby,Gerard
dult( self )->bool: LEGAL_AGE_US = 21 return LEGAL_AGE It doesn’t like LEGAL_AGE_US being all caps if declared in a function. From: Python-list on behalf of dn via Python-list Date: Thursday, February 23, 2023 at 5:46 PM To: python-list@python.org Subject: Re: Line continuation

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
On 22/02/2023 21.49, Robert Latest via Python-list wrote: I found myself building a complicated logical condition with many ands and ors which I made more manageable by putting the various terms on individual lines and breaking them with the "\" line continuation character. In this

RE: Line continuation and comments

2023-02-23 Thread avi.e.gross
. Had you written: HelpText = """ Left click: Open spam ... Shift + Right click:Fry egg """ Then it would begin with an extra carriage return you did not want. Your example also ends with a carriage return because you closed the quotes on another li

Re: Line continuation and comments

2023-02-23 Thread Rob Cliffe via Python-list
On 22/02/2023 15:23, Paul Bryan wrote: Adding to this, there should be no reason now in recent versions of Python to ever use line continuation. Black goes so far as to state "backslashes are bad and should never be used": https://black.readthedocs.io/en/stable/the_black_

Re: Line continuation and comments

2023-02-22 Thread Cameron Simpson
On 22Feb2023 11:27, Thomas Passin wrote: On 2/22/2023 10:02 AM, Weatherby,Gerard wrote: That’s a neat tip. End of line comments work, too x = (3 > 4 #never and 7 == 7 # hopefully or datetime.datetime.now().day > 15 # sometimes ) print(x) I find myself doing this mo

Re: Line continuation and comments

2023-02-22 Thread Thomas Passin
On 2/22/2023 10:02 AM, Weatherby,Gerard wrote: That’s a neat tip. End of line comments work, too x = (3 > 4 #never and 7 == 7 # hopefully or datetime.datetime.now().day > 15 # sometimes ) print(x) I find myself doing this more and more often. It can also help to mak

Re: Line continuation and comments

2023-02-22 Thread Weatherby,Gerard
That’s a neat tip. End of line comments work, too x = (3 > 4 #never and 7 == 7 # hopefully or datetime.datetime.now().day > 15 # sometimes ) print(x) From: Python-list on behalf of Edmondo Giovannozzi Date: Wednesday, February 22, 2023 at 9:40 AM To: python-list@pyth

Re: Line continuation and comments

2023-02-22 Thread Paul Bryan
Adding to this, there should be no reason now in recent versions of Python to ever use line continuation. Black goes so far as to state "backslashes are bad and should never be used": https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html#using-backslashe

Re: Line continuation and comments

2023-02-22 Thread Edmondo Giovannozzi
Il giorno mercoledì 22 febbraio 2023 alle 09:50:14 UTC+1 Robert Latest ha scritto: > I found myself building a complicated logical condition with many ands and > ors > which I made more manageable by putting the various terms on individual lines > and breaking them with

Line continuation and comments

2023-02-22 Thread Robert Latest via Python-list
I found myself building a complicated logical condition with many ands and ors which I made more manageable by putting the various terms on individual lines and breaking them with the "\" line continuation character. In this context it would have been nice to be able to add comments to l

Re: PEP-8, Line Length, And All That

2023-01-21 Thread Cameron Simpson
On 21Jan2023 01:32, Thomas Passin wrote: In another thread ("Improvement to imports, what is a better way ?") there was a lot of talk about line length, PEP-8, etc. I realized that one subject did not really come up, yet it can greatly affect the things we were talking about. I&#

PEP-8, Line Length, And All That

2023-01-20 Thread Thomas Passin
In another thread ("Improvement to imports, what is a better way ?") there was a lot of talk about line length, PEP-8, etc. I realized that one subject did not really come up, yet it can greatly affect the things we were talking about. I'm referring to the design of the fun

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

2022-12-21 Thread Barry
embed > arguments into things, and the ways that $*, $@, "$*, and "$@" behave > when put into variables). Not usually a problem, but it does sometimes > leave you thinking "wow, wouldn't it be easier to just use something > like Python?". And in the compl

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

2022-12-21 Thread Chris Angelico
On Thu, 22 Dec 2022 at 04:12, Barry wrote: > I see bash scripts that are 1000’s of line of code at work and its a > maintenance nightmare. > > Knowing when to make the move from “handy bash script” to “this is a > production application” and needs to be python is what I

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

2022-12-21 Thread Chris Angelico
On Thu, 22 Dec 2022 at 03:58, gene heskett wrote: > > On 12/21/22 11:22, Chris Angelico wrote: > > On Thu, 22 Dec 2022 at 03:11, Stefan Ram wrote: > >> > >> Lars Liedtke writes: > >>> Or you could have "native" bash ($SHELL) with WSL. > >> > >>In this newsgroup, it would actually be obvious

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

2022-12-21 Thread gene heskett
On 12/21/22 11:22, Chris Angelico wrote: On Thu, 22 Dec 2022 at 03:11, Stefan Ram wrote: Lars Liedtke writes: Or you could have "native" bash ($SHELL) with WSL. In this newsgroup, it would actually be obvious to use Python. Less obvious than you might think - partly because bash is ju

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

2022-12-21 Thread Chris Angelico
On Thu, 22 Dec 2022 at 03:11, Stefan Ram wrote: > > Lars Liedtke writes: > >Or you could have "native" bash ($SHELL) with WSL. > > In this newsgroup, it would actually be obvious to use Python. Less obvious than you might think - partly because bash is just so dang good that it's really really

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

2022-12-21 Thread Chris Angelico
On Thu, 22 Dec 2022 at 03:11, Jach Feng wrote: > > Chris Angelico 在 2022年12月21日 星期三下午1:02:01 [UTC+8] 的信中寫道: > > On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > > > That's what I am taking this path under Windows now, the ultimate > > > solution before Windows has shell similar to bash:-) > > Te

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

2022-12-21 Thread Jach Feng
Chris Angelico 在 2022年12月21日 星期三下午1:02:01 [UTC+8] 的信中寫道: > On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > > That's what I am taking this path under Windows now, the ultimate solution > > before Windows has shell similar to bash:-) > Technically, Windows DOES have a shell similar to bash. It's

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

2022-12-21 Thread Chris Angelico
On Wed, 21 Dec 2022 at 23:16, Albert-Jan Roskam wrote: > > > > On Dec 21, 2022 06:01, Chris Angelico wrote: > > On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > > That's what I am taking this path under Windows now, the ultimate solution > > before Windows has shell similar to bash:-) > > Techn

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

2022-12-21 Thread Lars Liedtke
Or you could have "native" bash ($SHELL) with WSL. But I assume not everyone is using it. Cheers Lars Lars Liedtke Software Entwickler [Tel.] +49 721 98993- [Fax] +49 721 98993- [E-Mail]l...@solute.de solute GmbH Zeppelinstraße 15 76185 Karlsruhe Germany

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

2022-12-21 Thread Albert-Jan Roskam
On Dec 21, 2022 06:01, Chris Angelico wrote: On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > That's what I am taking this path under Windows now, the ultimate solution before Windows has shell similar to bash:-) Technically, Windows DOES have a shell similar to bash. It'

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

2022-12-20 Thread Chris Angelico
On Wed, 21 Dec 2022 at 15:28, Jach Feng wrote: > That's what I am taking this path under Windows now, the ultimate solution > before Windows has shell similar to bash:-) Technically, Windows DOES have a shell similar to bash. It's called bash. :) The trouble is, most people use cmd.exe instead.

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

2022-12-20 Thread Jach Feng
ery...@gmail.com 在 2022年12月20日 星期二中午12:35:52 [UTC+8] 的信中寫道: > 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 &q

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

2022-12-20 Thread Jach Feng
> >>> "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-line shell you'

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"

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

2022-12-19 Thread Thomas Passin
it gives 8. Obviously the escape character didn't function correctly. How to do it? That depends on the command-line shell you're calling your script from. In bash, you can include a newline in a quoted string: ./your_script 'step ' (the closing quote is on the next line) Or if you

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

2022-12-19 Thread Jach Feng
sly the escape character didn't function > > correctly. How to do it? > That depends on the command-line shell you're calling your script from. > > In bash, you can include a newline in a quoted string: > ./your_script 'step > ' > (the closing quote

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

2022-12-19 Thread Mark Bourne
on the command-line shell you're calling your script from. In bash, you can include a newline in a quoted string: ./your_script 'step ' (the closing quote is on the next line) Or if you want to do it on a single line (or use other escape sequences), you can use e.g.: ./your_s

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: Single line if statement with a continue

2022-12-18 Thread Tony Oliver
On Saturday, 17 December 2022 at 23:58:11 UTC, avi.e...@gmail.com wrote: > Is something sort of taboo when using something like a computer language to > write a program? With what else would you write a program? -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >