Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A language that doesn't affect the way you think about programming is not worth knowing.


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

SubjectAuthor
* Baffled by readline moduleGrant Edwards
`- Re: Baffled by readline moduleStefan Ram

1
Baffled by readline module

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b....@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Baffled by readline module
Date: Thu, 09 Mar 2023 11:27:20 -0800 (PST)
Lines: 18
Message-ID: <mailman.2230.1678390044.20444.python-list@python.org>
References: <640a3318.020a0220.67dbd.001a@mx.google.com>
X-Trace: news.uni-berlin.de lgVQLsIyaSHI2aVtogWqBAEG+7OaIqH5FzAvL+x9u85g==
Return-Path: <grant.b.edwards@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=KtXVe4dQ;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.009
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'entering': 0.05; 'linux,':
0.07; 'subject:module': 0.07; 'likewise': 0.09; 'linux': 0.09;
'user.': 0.09; 'that.': 0.15; 'command-line': 0.16;
'from:addr:grant.b.edwards': 0.16; 'from:name:grant edwards':
0.16; 'recall': 0.16; 'received:209.85.166.170': 0.16; 'wrapper':
0.16; 'python': 0.16; 'gnu': 0.19; 'to:addr:python-list': 0.20;
"i've": 0.22; 'command': 0.23; 'examples': 0.25; 'stuff': 0.25;
'header:User-Agent:1': 0.30; 'module': 0.31; 'program': 0.31;
'files,': 0.32; 'but': 0.32; "i'm": 0.33; 'able': 0.34;
'received:google.com': 0.34; 'received:209.85.166': 0.35;
'from:addr:gmail.com': 0.35; 'files': 0.36; 'received:209.85':
0.37; 'read': 0.38; 'received:209': 0.39; 'use': 0.39; 'neither':
0.39; 'appears': 0.40; 'case.': 0.40; 'want': 0.40; 'provide':
0.60; "there's": 0.61; 'providing': 0.63; 'involve': 0.64; 'tool':
0.65; 'right': 0.68; 'history': 0.75; 'editing': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20210112; t=1678390041;
h=to:user-agent:subject:from:date:message-id:from:to:cc:subject:date
:message-id:reply-to;
bh=zJnVwIMfRSMRAPK1BZrAOqMA6oPTe0yfoMbQM2PiiqE=;
b=KtXVe4dQBeyoMU7lWaDNnX9vHNSXdu8LTQCBhCLj25beYKOPgqwmi9DZS2Y2YCnr1V
AHhadpO042zy7C6kAUOWCjMlfLmj/klfOz7L7K1DXz60nVHmjZFnkm0NrRilzHZlAGfD
6V9eg0Jrr3u3cv0qCRmVJwA7q/7liK9f2I51CCGDe2yTkmWinO/HcxCV3FC5Cu/6taKr
QmR58Wcsk7zRJTvDKmqF6f2msl/u+avKhmOY/gFzqNcxnI2SvaYvczZMh7drlcuEXpL6
r+hXlEuYu0zFPhIh98eVJprGzB30lEYBgYcSRVM24twyYh6/q4Aw2nNP2WmplO9R1/BV
AY+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112; t=1678390041;
h=to:user-agent:subject:from:date:message-id:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to;
bh=zJnVwIMfRSMRAPK1BZrAOqMA6oPTe0yfoMbQM2PiiqE=;
b=tG7kohxQdDBxbDZ/UlPGAZVk3ypY735cBsgS3OU+KL7WdbGcdXYnYgpOWQ71zWUZKN
wfb05ErJlgZBZVXc7dkznrhP4N+hJZ7re8DyxFZPR/VU0aeR91sTTogk3HYBqwG2Q3Xv
mhVXlmGqpcokwwJCJvb6jxgaplcUR0KYAMs2RCELnzpYoLTW7VslePMoapVyzLGjhIj3
N2aowCg7lcnPJZWu2KkZg8ypb+I1x0Amof6V9mN82qBE+iLvHWvZeKDJN0aO34vhlX35
ts+cztp+e3btcyxkUAq+hRltiie4Yfj14pdpA0FqgmVvAyqED+HNda7kN5ab7ARR8J0d
g4yw==
X-Gm-Message-State: AO0yUKUeVum0GnxhKcaFOu002tRRVhiKAXtTxgjIvaD6IWcCx9fV/8cR
iqAA5hOWnXxTLxzQXALWaGlhNS8ba18NgQ==
X-Google-Smtp-Source: AK7set8OVsNcnkACPPM1HEawePvlkBYTzA/rr7wcExIcMFS9KhEP8AsZRNvn1gnzFHLRuktZLcW8tA==
X-Received: by 2002:a05:6e02:1b82:b0:316:f980:da93 with SMTP id
h2-20020a056e021b8200b00316f980da93mr19600384ili.22.1678390041579;
Thu, 09 Mar 2023 11:27:21 -0800 (PST)
User-Agent: slrn/1.0.3 (Linux)
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: <640a3318.020a0220.67dbd.001a@mx.google.com>
 by: Grant Edwards - Thu, 9 Mar 2023 19:27 UTC

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?

Re: Baffled by readline module

<readline-20230309204017@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Baffled by readline module
Date: 9 Mar 2023 19:43:24 GMT
Organization: Stefan Ram
Lines: 10
Expires: 1 Jan 2024 11:59:58 GMT
Message-ID: <readline-20230309204017@ram.dialup.fu-berlin.de>
References: <mailman.2230.1678390044.20444.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de TvnBEh5vNXfE1VfUlVKKEwerhzqtI2kzTdVe+k1TblTsTu
X-Copyright: (C) Copyright 2023 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Thu, 9 Mar 2023 19:43 UTC

Grant Edwards <grant.b.edwards@gmail.com> writes:
>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?

I don't know whether it's this what you're looking for,
but check out the standard module "code" with classes
like "InteractiveInterpreter" and "InteractiveConsole"!

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor