On 10/03/23 4:00 pm, 2qdxy4rzwzuui...@potatochowder.com wrote:
My ~/.pythonrc contains the following:
import readline
import rlcompleter
readline.parse_and_bind( 'tab: complete' )
I don't have a ~/.pythonrc, so that's not what's doing it
for me.
--
Greg
--
https://mail.python.o
On 10/03/23 2:57 pm, Chris Angelico wrote:
import sys; "readline" in sys.modules
Is it?
Yes, it is -- but only when using the repl!
If I put that in a script, I get False.
My current theory is that it gets pre-imported when using
Python interactively because the repl itself uses it.
--
Greg
On 2023-03-09 at 19:11:56 -0800,
Grant Edwards wrote:
> On 2023-03-10, 2qdxy4rzwzuui...@potatochowder.com
> <2qdxy4rzwzuui...@potatochowder.com> wrote:
> If you run this application from the command line, you get command
> recall and editing when entering strings at the "cmd:" prompt?
>
> #!/u
On 2023-03-10, 2qdxy4rzwzuui...@potatochowder.com
<2qdxy4rzwzuui...@potatochowder.com> wrote:
> On 2023-03-10 at 12:57:48 +1100,
> Chris Angelico wrote:
>
>> On Fri, 10 Mar 2023 at 12:56, Greg Ewing via Python-list
>> wrote:
>> >
>> > On 10/03/23 1:46 pm, Grant Edwards wrote:
>> > > That's not h
On 2023-03-10 at 12:57:48 +1100,
Chris Angelico wrote:
> On Fri, 10 Mar 2023 at 12:56, Greg Ewing via Python-list
> wrote:
> >
> > On 10/03/23 1:46 pm, Grant Edwards wrote:
> > > That's not how it acts for me. I have to "import readline" to get
> > > command line recall and editing.
> >
> > Mayb
On Fri, 10 Mar 2023 at 12:56, Greg Ewing via Python-list
wrote:
>
> On 10/03/23 1:46 pm, Grant Edwards wrote:
> > That's not how it acts for me. I have to "import readline" to get
> > command line recall and editing.
>
> Maybe this has changed? Or is platform dependent?
>
> With Python 3.8 on MacO
On 10/03/23 1:46 pm, Grant Edwards wrote:
That's not how it acts for me. I have to "import readline" to get
command line recall and editing.
Maybe this has changed? Or is platform dependent?
With Python 3.8 on MacOSX I can use up arrow with input()
to recall stuff I've typed before, without ha
On 2023-03-10 at 11:02:52 +1100,
Chris Angelico wrote:
> Traditional retirement: Work till you're 60 or 65 or whatever, then
> society pats you on the head, calls you a "senior citizen", and lets
> you go and be idle till you die (which might be prematurely soon).
Sounds like Free Four¹:
The
On 2023-03-10, Greg Ewing via Python-list wrote:
> On 10/03/23 10:08 am, Grant Edwards wrote:
>> It finally dawned on me after seeing an example I found elsewhere that
>> you don't call some module method to fetch the next user-entered line.
>>
>> You call the input() built-in.
>>
>> Having a mo
On 10/03/23 12:43 pm, Grant Edwards wrote:
When a computer dies, I
generally just cp -a (or rsync -a) $HOME to a new one.
Same here, more or less. My current machine has multiple
archaeological layers going back about 5 generations of
technology...
--
Greg
--
https://mail.python.org/mailman/li
On 10/03/23 11:43 am, Chris Angelico wrote:
import readline
print("Pseudo-prompt: ", end="")
msg1 = input()
msg2 = input("Actual prompt: ")
print(repr(msg1))
print(repr(msg2))
At each of the prompts, type a bit of text, then backspace it all the
way. The actual prompt will remain, but the pseudo
On 10/03/23 10:59 am, Cameron Simpson wrote:
I think this might be the common case of a module which wraps another
library
It's not quite the same thing, though -- the library it wraps
is already hooked into things behind the scenes in ways that
may not be obvious. (Unless you're Dutch?)
--
Gr
On 10/03/23 10:08 am, Grant Edwards wrote:
It finally dawned on me after seeing an example I found elsewhere that
you don't call some module method to fetch the next user-entered line.
You call the input() built-in.
Having a module modify the behavior of a built-in makes me cringe.
Importing
On 3/9/23 16:37, Cameron Simpson wrote:
On 09Mar2023 09:06, Alan Gauld wrote:
Just a note that some code formatters use a trailing comma on the last
element to make the commas fold points. Both yapf (my preference) and
black let you write a line like (and, indeed, flatten if short enough):
On Fri, 10 Mar 2023 at 10:51, <2qdxy4rzwzuui...@potatochowder.com> wrote:
>
> On 2023-03-09 at 15:02:53 -0800,
> Grant Edwards wrote:
>
> > Yeesh. What's _really_ embarassing is that I just stumbled across a
> > small test program with which I had apparently figured this out 10-12
> > years ago.
On 09Mar2023 13:08, Grant Edwards wrote:
Having a module modify the behavior of a built-in makes me cringe.
Maybe. But input(), like print(), is one of those funky conveniences for
human interaction. I'm somewhat ok with that. If for no other reason
than to make keyboard arrow keys act as no
On 2023-03-09 at 15:02:53 -0800,
Grant Edwards wrote:
> Yeesh. What's _really_ embarassing is that I just stumbled across a
> small test program with which I had apparently figured this out 10-12
> years ago. Must be about time to retire...
Retiring doesn't help. :-)
I retired almost five yea
On 2023-03-09, Chris Angelico wrote:
> On Fri, 10 Mar 2023 at 10:04, Grant Edwards wrote:
>
>> Yeesh. What's _really_ embarassing is that I just stumbled across a
>> small test program with which I had apparently figured this out
>> 10-12 years ago. Must be about time to retire...
>
> You expect
On Fri, 10 Mar 2023 at 10:04, Grant Edwards wrote:
>
> Yeesh. What's _really_ embarassing is that I just stumbled across a
> small test program with which I had apparently figured this out 10-12
> years ago. Must be about time to retire...
>
You expect yourself to remember test programs you wrot
On 2023-03-09, Grant Edwards wrote:
> On 2023-03-09, Cameron Simpson wrote:
>
>> [...]
>>>It finally dawned on me after seeing an example I found elsewhere that
>>>you don't call some module method to fetch the next user-entered line.
>>>
>>>You call the input() built-in.
>>
>> Ah. That's not ove
On Fri, 10 Mar 2023 at 09:20, Grant Edwards wrote:
>
> On 2023-03-09, Cameron Simpson wrote:
>
> > [...]
> >>It finally dawned on me after seeing an example I found elsewhere that
> >>you don't call some module method to fetch the next user-entered line.
> >>
> >>You call the input() built-in.
>
On 3/9/23 04:06, Alan Gauld wrote:
Thank you for the feedback, I appreciate the comments.
To add a little extra, there is actually a reason I lean toward overuse
of .config() for a lot of things even though they could be sent to the
constructor (other than that w["attribute"]= doesn't work
On 2023-03-09, Cameron Simpson wrote:
> [...]
>>It finally dawned on me after seeing an example I found elsewhere that
>>you don't call some module method to fetch the next user-entered line.
>>
>>You call the input() built-in.
>
> Ah. That's not overtly stated? [...reads...] Ah, there it is in t
On Fri, 10 Mar 2023 at 09:01, Cameron Simpson wrote:
> I think this might be the common case of a module which wraps another
> library: there's a tension between describing everything in pointless
> detail and the trite "we're just shimming this library, go read its
> docs".
Yeah, it's a combinat
On Fri, 10 Mar 2023 at 07:43, Thomas Passin wrote:
>
> On 3/9/2023 3:29 AM, aapost wrote:
> > The 'what I am trying to do' is ask a question regarding opinions and
> > practices on issuing a sequence of actions within a lambda via a tuple
> > (since the common practice approaches against it - main
On 09Mar2023 13:08, Grant Edwards wrote:
On 2023-03-09, Chris Angelico wrote:
Not sure about the history file, and I would assume that if you don't
configure one, history is simply lost when you restart. But with tab
completion, unless you need to be able to input a tab character, it
should be
On Fri, 10 Mar 2023 at 08:10, Grant Edwards wrote:
> What's really weird about the docs is that when it is described it
> doesn't even _mention_ that it provides command-line recall and
> editing:
>
> It just talks about manipulating history files and about
> tab-completion of Python identfiers.
On 09Mar2023 09:06, Alan Gauld wrote:
Also layout is all important here. It could get very messy to read if
indentation isn't clear. You only have to look at some Javascript code
with function definitions as arguments to functions to see how clunky
that can be.
Just a note that some code forma
On 09Mar2023 09:06, Alan Gauld wrote:
On 08/03/2023 21:56, aapost wrote:
When making a UI there are a lot of binding/trace operations that need
to occur that lead to a lot of annoying 1 use function definitions. I
don't really see lambda use like below.
Lambdas are very common in GUI callback
On 2023-03-09, Chris Angelico wrote:
> Not sure about the history file, and I would assume that if you don't
> configure one, history is simply lost when you restart. But with tab
> completion, unless you need to be able to input a tab character, it
> should be safe to ignore the feature and leav
On 3/9/2023 3:29 AM, aapost wrote:
The 'what I am trying to do' is ask a question regarding opinions and
practices on issuing a sequence of actions within a lambda via a tuple
(since the common practice approaches against it - mainly with tkinter -
feel more convoluted), and in doing so leaving
On Fri, 10 Mar 2023 at 06:28, Grant Edwards wrote:
>
> In an interactive command-line Python program on Linux, I want to be
> able to read a line at a time from stdin, providing command line
> history and editing to the user. In C, I would use GNU readline to do
> that.
>
> Python has the readline
On 2023-03-09, Grant Edwards wrote:
> In an interactive command-line Python program on Linux, I want to be
> able to read a line at a time from stdin, providing command line
> history and editing to the user. In C, I would use GNU readline to do
> that.
>
> Python has the readline module, which a
In an interactive command-line Python program on Linux, I want to be
able to read a line at a time from stdin, providing command line
history and editing to the user. In C, I would use GNU readline to do
that.
Python has the readline module, which appears to be a wrapper for GNU
readline. However,
On 3/9/23 00:13, Thomas Passin wrote:
lol.. 'us'..
So.. to give an example from your own code:
but_play = Tk.Button(_frame, text='Play', width = BUTTONWIDTH + 1, pady
= PADY, command=lambda x=plotmgr:play_macro(x), bg = BUTTON_BG, font =
NEWFONT)
Can be written as:
b = Tk.Button(master=
On 08/03/2023 04:37, Thomas Wouters wrote:
I'm pleased to announce the release of Python 3.12 alpha 6.
https://www.python.org/downloads/release/python-3120a6/
*This is an early developer preview of Python 3.12.*
Major new features of the 3.12 series, compared to 3.11
I was able to test repo
Other than the admittedly subjective viewpoint that using the lambda is
confusing, there’s probably nothing wrong with the lambda approach. A couple of
alternatives:
def e():
for e in (e1,e2,e3):
e.config(state="normal")
b = tk.Button(master=main, text="Enable",command=e)
or
b =
On 08/03/2023 21:56, aapost wrote:
> When making a UI there are a lot of binding/trace operations that need
> to occur that lead to a lot of annoying 1 use function definitions. I
> don't really see lambda use like below.
Lambdas are very common in GUI callbacks but I admit I've never seen
tuple
38 matches
Mail list logo