Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Open Channel D..." -- Napoleon Solo, The Man From U.N.C.L.E.


devel / comp.lang.python / Re: Baffled by readline module

SubjectAuthor
o Re: Baffled by readline moduleChris Angelico

1
Re: Baffled by readline module

<mailman.2232.1678392011.20444.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=22305&group=comp.lang.python#22305

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Baffled by readline module
Date: Fri, 10 Mar 2023 06:59:58 +1100
Lines: 27
Message-ID: <mailman.2232.1678392011.20444.python-list@python.org>
References: <640a3318.020a0220.67dbd.001a@mx.google.com>
<CAPTjJmpxn5sQ+QLQeCpT+yZXbaTdEkcWghcOavxcTTVheN6wTA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de wK+oIvMWKhEDsScA7GPMpAjf5gVTci5bGn1NM/eEiwJA==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=AKw8SdBH;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'entering': 0.05; '2023':
0.07; 'linux,': 0.07; 'mar': 0.07; 'subject:module': 0.07; 'tab':
0.07; 'likewise': 0.09; 'linux': 0.09; 'user.': 0.09; 'that.':
0.15; 'chrisa': 0.16; 'command-line': 0.16; 'from:addr:rosuav':
0.16; 'from:name:chris angelico': 0.16; 'recall': 0.16; 'wrapper':
0.16; 'wrote:': 0.16; 'python': 0.16; 'grant': 0.17; 'gnu': 0.19;
'to:addr:python-list': 0.20; 'input': 0.21; "i've": 0.22; 'fri,':
0.22; 'command': 0.23; 'examples': 0.25; 'stuff': 0.25;
'configure': 0.26; 'leave': 0.27; 'module': 0.31; 'program': 0.31;
'assume': 0.32; 'files,': 0.32; 'message-id:@mail.gmail.com':
0.32; 'unless': 0.32; 'but': 0.32; "i'm": 0.33; 'able': 0.34;
'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'files': 0.36; 'received:209.85':
0.37; 'read': 0.38; 'received:209': 0.39; 'received:209.85.208':
0.39; 'safe': 0.39; 'use': 0.39; 'neither': 0.39; 'appears': 0.40;
'case.': 0.40; 'want': 0.40; 'should': 0.40; 'provide': 0.60;
"there's": 0.61; 'simply': 0.63; 'providing': 0.63; 'involve':
0.64; 'lost': 0.64; 'tool': 0.65; 'right': 0.68; 'ignore': 0.71;
'history': 0.75; 'editing': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20210112; t=1678392010;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=09vW6d0Bp/AbrNJYI7TCB4I350SLTQPZuatUDLPPds4=;
b=AKw8SdBHVgcTh7YEdpMWj+s0yHThC1jxJceL5211wZftIBDwgDNkx13Z1lm6hIrlE+
5aaNCfWjICGXoyc+ef6pvYzsIZmaG+KBOqNXc4libLH6En6QGit9sWT6cNLz0MupxoW6
Fsa5cQhSNGgZc8Mr6EcvJ2jUJj2dtA5lVmZYXEbpbxkWxK1soalGe6NNEy1YoMEjP/vl
6AS6AwgDqhWPVqCM/PYRJn4qde4lKCbajQCKzzOO+niNEfWOfsJsF/oVhN64w4WI1eK4
5fVL0b6I4GuXcJ0vJuV1+e+fT9COudfz/2z9mpa++6aFQlr5PikrUqoSQU7V5hgc+S0Z
rqSQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112; t=1678392010;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=09vW6d0Bp/AbrNJYI7TCB4I350SLTQPZuatUDLPPds4=;
b=iiixUerLhZ43j4kD447yTiizH0ci2/ahaPMsrOweHjQDEmSsLxw7k0OpdI/QJbi5WX
D4q1+RGaVOxjyVkp/3W3oIV1LKjKv7L6qG0FIaCNl0nm5HIUTkBFEb76i8ZpKe153qMi
F5XwiDoisTCp4VHd4xOFDv9J64bJ7A3qnDfd+6kl3sUSwxpus5+gM3W/hybkyC23KOlW
yaKCKLZwW9IL5GPy9SlsJnKDXi6VFpE9uqN2C9YC3ScB7PLEIY/2ye2pgmk0QZ8t9JbZ
e4Y6Pm6f7RG8Mp69P0/ksMJkPBdDw15P9Nc2hN/3c0ibPDZVTA9Pv/DOYpfpNO9jnpM+
gNfA==
X-Gm-Message-State: AO0yUKUSdgyRJv3Q6eO1uR9aFK1LpanIXMSH3bBsBs+FMrcVzGm0zE7d
s1t/uChclh3En4sym17KCgvDzxm63QMOH+wzruQbA6Ni
X-Google-Smtp-Source: AK7set+oD5sAcfmkghqz3nMjtq8pLizSPktOfAjd1t2Sv2pQ/XQ6uYwJdFdwPg18P0N7DgE0HAtmFBYg97oLwYFGzzA=
X-Received: by 2002:a17:906:1255:b0:87d:ce4:eb7a with SMTP id
u21-20020a170906125500b0087d0ce4eb7amr7804267eja.13.1678392009787; Thu, 09
Mar 2023 12:00:09 -0800 (PST)
In-Reply-To: <640a3318.020a0220.67dbd.001a@mx.google.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmpxn5sQ+QLQeCpT+yZXbaTdEkcWghcOavxcTTVheN6wTA@mail.gmail.com>
X-Mailman-Original-References: <640a3318.020a0220.67dbd.001a@mx.google.com>
 by: Chris Angelico - Thu, 9 Mar 2023 19:59 UTC

On Fri, 10 Mar 2023 at 06:28, Grant Edwards <grant.b.edwards@gmail.com> 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 appears to be a wrapper for GNU
> readline. However, I've read and re-read the documenation for that
> module, but I'm completely baffled. There's all sorts of stuff about
> history files, but I neither need nor want a history file. Likewise
> tab-completion: don't want it. All the examples not only involve
> history files and tab-completion but they're somehow connected to the
> interactive Python REPL, which is also completely off-base for my use
> case.
>
> Is the readline module not the right tool for an interactive Linux
> command-line application that needs to provide command line recall and
> editing to the user who's entering stuff on stdin from a tty?
>

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 leave it at the defaults.

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor