Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

I don't think it's worth washing hogs over. -- Larry Wall in <199710060253.TAA09723@wall.org>


devel / comp.lang.python / Re: How to enter escape character in a positional string argument from the command line?

SubjectAuthor
* How to enter escape character in a positional string argument fromJach Feng
`* Re: How to enter escape character in a positional string argumentMark Bourne
 `* Re: How to enter escape character in a positional string argumentJach Feng
  +* Re: How to enter escape character in a positional string argumentThomas Passin
  |`* Re: How to enter escape character in a positional string argumentJach Feng
  | `* Re: How to enter escape character in a positional string argumentChris Angelico
  |  `* Re: How to enter escape character in a positional string argumentJach Feng
  |   `- Re: How to enter escape character in a positional string argumentChris Angelico
  `* Re: How to enter escape character in a positional string argumentEryk Sun
   `- Re: How to enter escape character in a positional string argumentJach Feng

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

<6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:6214:5f08:b0:4bc:1237:c611 with SMTP id lx8-20020a0562145f0800b004bc1237c611mr56778191qvb.126.1670202912966;
Sun, 04 Dec 2022 17:15:12 -0800 (PST)
X-Received: by 2002:a4a:95ad:0:b0:498:3383:9333 with SMTP id
o42-20020a4a95ad000000b0049833839333mr26219731ooi.58.1670202912742; Sun, 04
Dec 2022 17:15:12 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Sun, 4 Dec 2022 17:15:12 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=218.166.10.101; posting-account=G2sM6AoAAADOlDdo9rWD6sFkj3T5ULsz
NNTP-Posting-Host: 218.166.10.101
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
Subject: How to enter escape character in a positional string argument from
the command line?
From: jfong@ms4.hinet.net (Jach Feng)
Injection-Date: Mon, 05 Dec 2022 01:15:12 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1294
 by: Jach Feng - Mon, 5 Dec 2022 01:15 UTC

I have a script using the argparse module. I want to enter the string "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?

--Jach

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

<tnqinh$l03$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!idJRGDhWvgrxDZls6jh7rw.user.46.165.242.75.POSTED!not-for-mail
From: nntp.mbourne@spamgourmet.com (Mark Bourne)
Newsgroups: comp.lang.python
Subject: Re: How to enter escape character in a positional string argument
from the command line?
Date: Mon, 19 Dec 2022 20:48:49 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tnqinh$l03$1@gioia.aioe.org>
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="21507"; posting-host="idJRGDhWvgrxDZls6jh7rw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
SeaMonkey/2.53.14
X-Notice: Filtered by postfilter v. 0.9.2
 by: Mark Bourne - Mon, 19 Dec 2022 20:48 UTC

Jach Feng wrote:
> I have a script using the argparse module. I want to enter the string "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 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_script $'step\x0a'
(dollar sign before a single-quoted string which contains escape sequences)

--
Mark.

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

<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:6214:9b2:b0:4c7:54b0:5523 with SMTP id du18-20020a05621409b200b004c754b05523mr21476955qvb.18.1671503089558;
Mon, 19 Dec 2022 18:24:49 -0800 (PST)
X-Received: by 2002:a05:6871:4504:b0:144:43c2:6a47 with SMTP id
nj4-20020a056871450400b0014443c26a47mr1810219oab.212.1671503089298; Mon, 19
Dec 2022 18:24:49 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 19 Dec 2022 18:24:49 -0800 (PST)
In-Reply-To: <tnqinh$l03$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=218.166.10.170; posting-account=G2sM6AoAAADOlDdo9rWD6sFkj3T5ULsz
NNTP-Posting-Host: 218.166.10.170
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com> <tnqinh$l03$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
Subject: Re: How to enter escape character in a positional string argument
from the command line?
From: jfong@ms4.hinet.net (Jach Feng)
Injection-Date: Tue, 20 Dec 2022 02:24:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2231
 by: Jach Feng - Tue, 20 Dec 2022 02:24 UTC

Mark Bourne 在 2022年12月20日 星期二凌晨4:49:13 [UTC+8] 的信中寫道:
> Jach Feng wrote:
> > I have a script using the argparse module. I want to enter the string "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 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_script $'step\x0a'
> (dollar sign before a single-quoted string which contains escape sequences)
>
> --
> Mark.
That's really good for Linux user! How about Windows?

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: list1@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: How to enter escape character in a positional string argument
from the command line?
Date: Mon, 19 Dec 2022 22:36:10 -0500
Lines: 39
Message-ID: <mailman.1278.1671507379.20444.python-list@python.org>
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
<c2d88e02-718e-330b-a752-57b4e257be58@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de vr+3Ybg24XB+Erv8uG4GlAfDdEheYo6d6LK/6eDODgpQ==
Return-Path: <list1@tompassin.net>
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=tompassin.net header.i=@tompassin.net header.b=Rxb1Za0V;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.04; 'mark.':
0.07; 'string': 0.07; 'linux': 0.09; 'module.': 0.09; 'obviously':
0.09; 'regex': 0.09; 'possible,': 0.15; 'command-line': 0.16;
'newline': 0.16; 'received:10.0.0': 0.16; 'received:64.90': 0.16;
'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16;
'received:dreamhost.com': 0.16; 'string:': 0.16; 'subject:string':
0.16; 'wrote:': 0.16; 'python': 0.16; 'figure': 0.19; 'it?': 0.19;
'pm,': 0.19; 'to:addr:python-list': 0.20; 'subject:How': 0.23;
'actual': 0.25; 'depends': 0.25; 'function': 0.27; '>>>': 0.28;
'expect': 0.28; 'example,': 0.28; 'header:User-Agent:1': 0.30;
'before.': 0.31; 'received:10.0': 0.32;
'received:mailchannels.net': 0.32;
'received:relay.mailchannels.net': 0.32; 'mark': 0.32; 'skip:2
10': 0.32; 'but': 0.32; 'there': 0.33; 'script': 0.33; "didn't":
0.34; 'header:In-Reply-To:1': 0.34; 'special': 0.37;
'subject:from': 0.37; 'really': 0.37; 'using': 0.37; 'hard': 0.37;
'way': 0.38; 'single': 0.39; 'use': 0.39; 'want': 0.40; 'gives':
0.62; 'your': 0.64; 'header:Received:6': 0.67; 'received:64':
0.67; 'closing': 0.69; 'it:': 0.69; 'quote': 0.74; '8bit%:100':
0.76; 'combinations': 0.84; 'from.': 0.84; 'subject: \n ': 0.84
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1671507372; a=rsa-sha256;
cv=none;
b=HYUUgMNiysKAUDzb5Ndff1Lwuh+thzkBTxLZhAyJJXZWbJntVruvuOqhzSbEMwMvNyZS4X
+DJG+TxV8BvmWmOtWFJLiU0fzqeuFY/vwGp3Ql3R7e/pCC8ywAXstZXGB1PE06IXKhTw9G
qrrHGre/LIBqTNuZDkmO+O8JWop7u6JyhUX7CyhZt9cc5xDmNicTIOEl+Z2lSuUevnqsHe
uYI3H9flgAFgyFqYUGKlgtemkH3B4poJ38KP9dyhx1eHyRlFFYTycqHey8tQGpbgFFzCCj
7cdlQqGr8/Jis/IJG6Mf6mNI7tyZMWI5o9KNu4YjUMMi1Qw5AwKznGHZpHlJog==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1671507372;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:dkim-signature;
bh=t0ooZTekZ0/YUX5b/k89M2sJEMIZltyuVpdSuvODwMM=;
b=EnyIXZn+3Mv8JLrycKZ01EsppfB7882G71q163NfkzNobuPqIO/b7ehbrFG7RDxbxLTqDt
hZkTaax3y13mKhHYzlt1HERyUnbIaV3Dqw8kcHLGVCblFT3SCLZdQqocKcZmKiXiViuQ9S
OTog4w+vaQRy2paqJDdvv390Wj41Lo+Ff5OAYm511akItB+XknDJMy6gfxh6eLdgiapPrE
ned7xqEeqwD4Xm7vfn1sxBX25TFlZPKkHgPPNmqT1Ipat74NneD44K1SYOBTV901fRIpGp
w9FiZZmFuZ8KfkWPW9IZuTk5JpBMon7YQ+6tAfQG176Cg+cSn1Xk+JPGe3Nmmw==
ARC-Authentication-Results: i=1; rspamd-56db58bdfc-sgrmf;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Tank-Ski: 443f669b4f2298e3_1671507372504_703206953
X-MC-Loop-Signature: 1671507372504:3825415494
X-MC-Ingress-Time: 1671507372504
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1671507372;
bh=t0ooZTekZ0/YUX5b/k89M2sJEMIZltyuVpdSuvODwMM=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=Rxb1Za0VckwVpODSvZnni9BWoAqQJi2LIT7nJl1l9Np/9s83OVMQkvr/v2h46ttV3
pI1m+4OkpQMQJALlrUCorGvBE8tO44C3TcawkXKQK9hRMcYkiC0JT/m3I6sb+IZTt7
iZ5yz2f3LfjR6AIAJpiRm4hA8yCL6P7A377QmY8eQSTObEM2iImR3ReIAEpKvuqJq1
bSQLMSQH7I+fi61R6w1wPfS6JVzstfGIX6yh41rh31qOFQCwOJ9k0qFrliSR8yhzog
hrpY249BQq4FxbyA5dMMHWyIEBrz75YrBIW8muldbsUySe1FIHAYt54+hRLSYQH6Ic
qMUBTLH9aiQjQ==
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.0
Content-Language: en-US
In-Reply-To: <c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.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: <c2d88e02-718e-330b-a752-57b4e257be58@tompassin.net>
X-Mailman-Original-References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
 by: Thomas Passin - Tue, 20 Dec 2022 03:36 UTC

On 12/19/2022 9:24 PM, Jach Feng wrote:
> Mark Bourne 在 2022年12月20日 星期二凌晨4:49:13 [UTC+8] 的信中寫道:
>> Jach Feng wrote:
>>> I have a script using the argparse module. I want to enter the string "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 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_script $'step\x0a'
>> (dollar sign before a single-quoted string which contains escape sequences)
>>
>> --
>> Mark.
> That's really good for Linux user! How about Windows?

One way is to process the argument after it gets into Python rather than
before. How hard that will be depends on how general you need the
argument to be. For your actual example, the argument comes into Python
as if it were

arg1 = r"step\x0A" # or "step\\x0a"

You can see if there is an "\\x":

pos = arg1.find('\\x') # 4

Replace or use a regex to replace it:

arg1_fixed = arg1.replace('\\x0A', '\n')

Naturally, if "\\x0A" is only a special case and other combinations are
possible, you will need to figure out what you need and do some more
complicated processing.

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: eryksun@gmail.com (Eryk Sun)
Newsgroups: comp.lang.python
Subject: Re: How to enter escape character in a positional string argument
from the command line?
Date: Mon, 19 Dec 2022 22:35:27 -0600
Lines: 28
Message-ID: <mailman.1279.1671510931.20444.python-list@python.org>
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
<CACL+1au_PQiVXi4XW892gphT=+HnTTaFwTxTuN4xjW_OJCmuwQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de /LH3DBsFq43FhQi+C5Gr0gtxjAlOgAxL8a7c/7aS0L8w==
Return-Path: <eryksun@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=JBwBqmod;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.006
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'entering': 0.05; 'cc:addr
:python-list': 0.09; 'example:': 0.09; 'linux': 0.09; 'string,':
0.09; 'cc:no real name:2**0': 0.14; '"import': 0.16; 'arguments':
0.16; 'command-line': 0.16; 'input.': 0.16; 'newline': 0.16;
'prompts': 0.16; 'quotes.': 0.16; 'subject:string': 0.16;
'typing': 0.16; 'wrote:': 0.16; 'cc:addr:python.org': 0.20;
'command': 0.23; 'subject:How': 0.23; 'cc:2**0': 0.25; 'space':
0.26; 'again,': 0.26; 'message-id:@mail.gmail.com': 0.32;
'requires': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35; 'also,':
0.36; 'subject:from': 0.37; 'really': 0.37; "it's": 0.37;
'received:209.85': 0.37; 'received:209': 0.39; 'use': 0.39;
'prompt': 0.39; 'rest': 0.39; 'want': 0.40; 'above': 0.62;
"you'll": 0.73; 'more?': 0.84; 'strings': 0.84; 'subject: \n ':
0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=cc:to:subject:message-id:date:from:references:in-reply-to
:mime-version:from:to:cc:subject:date:message-id:reply-to;
bh=mvpw7H0j1tpIFMuT1lt3kJj7AZ5YJDDotW6RUldGpvQ=;
b=JBwBqmodGLbW/WhpgUFaLm8nH0lVnVjNfQOmWZF3O5huWmREMkql/nQdBGQ+vYmuTj
ykw6M2Ejax4OHfh4xwxrbuPdCBgtklCA/NnO3RnPsT14gBBHmoeQKavIpnlkJz/yVbQK
U3RppwuZME92poO7ozUqsYAikgIKDZJBpb2Vzo4no7NwD9k0e1MS2I5smLbjrObuylCO
7Bx/1nVd1nW/VuTENR3pDGfJkGHvaTuXaMK2C6gCU0eCrUJ1Cm0GTvvtoZCnq5E4UTGr
GuepT97YEG6LZS4gj0Q1tV72NWextGEjUU92EtVJ0Pfk/dimZ9m8AHe8rSvEOaa70hZ8
uUig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=cc:to:subject:message-id:date:from:references:in-reply-to
:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=mvpw7H0j1tpIFMuT1lt3kJj7AZ5YJDDotW6RUldGpvQ=;
b=08tprZs23emQ2/jgaVqRAKIAI3PD9B/tN0OCW7taIK/wGA/J05ZvyH1FoNIhCbaFLA
zRttvWksmmxD7Wjz1LEx+7TKqCdRBqk4vZR8CWj/VlrRjyWcmSOOwzgx+zFlL6q6VmPN
6pAKB7J4Ckcn4tTGNSrvNHB6/VKpR6lvTzrpTfxmxO/NsWdtsY+TzrGT4KEi7QXxBC3c
L7Iq8W1xJAkjgUlVXRGxaNHGl6RNlEOUv8iOCPCCvHdcanIbrktZXZjw8I+f68qBZC1+
CE9aCPTxPbf99uGWeOz8cv8rTxBqTThCxOPED7CjfD0EGgESP6+YkYjWluod6vDPXvV6
I0hQ==
X-Gm-Message-State: ANoB5plzHS3t+F+zNn4ediNk/ntKQvCEGfBr6ao3SuL9zx58rD5/1dpX
doIRa65oaegvng+qi0El/aEugPjYXSpLchFwoEwzu4Am
X-Google-Smtp-Source: AA0mqf6FTmNlBMlVfMcdnjvKRMhb8o6gQfjHtt4Yzy6RXftfxeZHoEN3nh6nVHDf1qfl5UC5MTxo07Yx/N9oIY29sKY=
X-Received: by 2002:aca:1c11:0:b0:35b:e81e:131 with SMTP id
c17-20020aca1c11000000b0035be81e0131mr1268368oic.233.1671510928277; Mon, 19
Dec 2022 20:35:28 -0800 (PST)
In-Reply-To: <c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.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: <CACL+1au_PQiVXi4XW892gphT=+HnTTaFwTxTuN4xjW_OJCmuwQ@mail.gmail.com>
X-Mailman-Original-References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
 by: Eryk Sun - Tue, 20 Dec 2022 04:35 UTC

On 12/19/22, Jach Feng <jfong@ms4.hinet.net> 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" prompt in which you can write the rest of
the command line. Command-line arguments are separated by spaces, so
you have to start the next line with a space if you want it to be a
new argument. Also, "^" is a literal character when it's in a
double-quoted string, which requires careful use of quotes. For
example:

C:\>py -c "import sys; print(sys.orig_argv[3:])" spam^
More?
More? eggs^
More?
More? " and spam"
['spam\n', 'eggs\n and spam']

The above is easier in PowerShell, which supports entering multiline
strings without having to escape the newline. The second-level prompt
is ">> ". For example:

> py -c "import sys; print(sys.orig_argv[3:])" spam"
>> " eggs"
>> and spam"
['spam\n', 'eggs\n and spam']

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

<e5b9a0c4-143e-411f-a779-58c30a32ca99n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:6214:3b87:b0:4c6:d6b2:736a with SMTP id nf7-20020a0562143b8700b004c6d6b2736amr17559qvb.57.1671592246591;
Tue, 20 Dec 2022 19:10:46 -0800 (PST)
X-Received: by 2002:a05:6830:1b62:b0:66e:ac28:a4d7 with SMTP id
d2-20020a0568301b6200b0066eac28a4d7mr24639ote.54.1671592246322; Tue, 20 Dec
2022 19:10:46 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 20 Dec 2022 19:10:46 -0800 (PST)
In-Reply-To: <mailman.1278.1671507379.20444.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=218.166.10.247; posting-account=G2sM6AoAAADOlDdo9rWD6sFkj3T5ULsz
NNTP-Posting-Host: 218.166.10.247
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org> <c2d88e02-718e-330b-a752-57b4e257be58@tompassin.net>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com> <mailman.1278.1671507379.20444.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e5b9a0c4-143e-411f-a779-58c30a32ca99n@googlegroups.com>
Subject: Re: How to enter escape character in a positional string argument
from the command line?
From: jfong@ms4.hinet.net (Jach Feng)
Injection-Date: Wed, 21 Dec 2022 03:10:46 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3522
 by: Jach Feng - Wed, 21 Dec 2022 03:10 UTC

Thomas Passin 在 2022年12月20日 星期二上午11:36:41 [UTC+8] 的信中寫道:
> On 12/19/2022 9:24 PM, Jach Feng wrote:
> > Mark Bourne 在 2022年12月20日 星期二凌晨4:49:13 [UTC+8] 的信中寫道:
> >> Jach Feng wrote:
> >>> I have a script using the argparse module. I want to enter the string "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 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_script $'step\x0a'
> >> (dollar sign before a single-quoted string which contains escape sequences)
> >>
> >> --
> >> Mark.
> > That's really good for Linux user! How about Windows?
> One way is to process the argument after it gets into Python rather than
> before. How hard that will be depends on how general you need the
> argument to be. For your actual example, the argument comes into Python
> as if it were
>
> arg1 = r"step\x0A" # or "step\\x0a"
>
> You can see if there is an "\\x":
>
> pos = arg1.find('\\x') # 4
>
> Replace or use a regex to replace it:
>
> arg1_fixed = arg1.replace('\\x0A', '\n')
>
> Naturally, if "\\x0A" is only a special case and other combinations are
> possible, you will need to figure out what you need and do some more
> complicated processing.
That's what I am taking this path under Windows now, the ultimate solution before Windows has shell similar to bash:-)

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

<fa17a3d4-5762-4c0c-a341-8cb819d8275dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:698a:0:b0:3a9:8df0:d02f with SMTP id o10-20020ac8698a000000b003a98df0d02fmr2904qtq.258.1671592745656;
Tue, 20 Dec 2022 19:19:05 -0800 (PST)
X-Received: by 2002:a05:6870:5627:b0:13b:a68d:6185 with SMTP id
m39-20020a056870562700b0013ba68d6185mr4286oao.177.1671592745361; Tue, 20 Dec
2022 19:19:05 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 20 Dec 2022 19:19:05 -0800 (PST)
In-Reply-To: <mailman.1279.1671510931.20444.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=218.166.10.247; posting-account=G2sM6AoAAADOlDdo9rWD6sFkj3T5ULsz
NNTP-Posting-Host: 218.166.10.247
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org> <CACL+1au_PQiVXi4XW892gphT=+HnTTaFwTxTuN4xjW_OJCmuwQ@mail.gmail.com>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com> <mailman.1279.1671510931.20444.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fa17a3d4-5762-4c0c-a341-8cb819d8275dn@googlegroups.com>
Subject: Re: How to enter escape character in a positional string argument
from the command line?
From: jfong@ms4.hinet.net (Jach Feng)
Injection-Date: Wed, 21 Dec 2022 03:19:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2853
 by: Jach Feng - Wed, 21 Dec 2022 03:19 UTC

ery...@gmail.com 在 2022年12月20日 星期二中午12:35:52 [UTC+8] 的信中寫道:
> On 12/19/22, Jach Feng <jf...@ms4.hinet.net> 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" prompt in which you can write the rest of
> the command line. Command-line arguments are separated by spaces, so
> you have to start the next line with a space if you want it to be a
> new argument. Also, "^" is a literal character when it's in a
> double-quoted string, which requires careful use of quotes. For
> example:
>
> C:\>py -c "import sys; print(sys.orig_argv[3:])" spam^
> More?
> More? eggs^
> More?
> More? " and spam"
> ['spam\n', 'eggs\n and spam']
>
> The above is easier in PowerShell, which supports entering multiline
> strings without having to escape the newline. The second-level prompt
> is ">> ". For example:
>
> > py -c "import sys; print(sys.orig_argv[3:])" spam"
> >> " eggs"
> >> and spam"
> ['spam\n', 'eggs\n and spam']
Thanks for the information. No idea Windows CMD can take such a trick to enter "\n" :-)

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: How to enter escape character in a positional string argument
from the command line?
Date: Wed, 21 Dec 2022 16:01:25 +1100
Lines: 7
Message-ID: <mailman.1284.1671598898.20444.python-list@python.org>
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org>
<c2d88e02-718e-330b-a752-57b4e257be58@tompassin.net>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
<mailman.1278.1671507379.20444.python-list@python.org>
<e5b9a0c4-143e-411f-a779-58c30a32ca99n@googlegroups.com>
<CAPTjJmr2ecsGH=eNR+PTDOZg5LSu-JyteGVqi+RqVgKHSJBk+g@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de HDzCmDMYOXKui8u0JtQr0Q3PzCMsXV+v7e/QDeKZoNMw==
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=dVp1f9JH;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.027
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; '2022': 0.05; 'ultimate':
0.09; 'chrisa': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'instead.': 0.16; 'received:209.85.218': 0.16;
'subject:string': 0.16; 'wrote:': 0.16; 'to:addr:python-list':
0.20; 'subject:How': 0.23; 'dec': 0.31; 'message-
id:@mail.gmail.com': 0.32; 'path': 0.33; 'windows': 0.34; 'header
:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'people': 0.36; 'subject:from': 0.37;
"it's": 0.37; 'received:209.85': 0.37; 'received:209': 0.39;
'use': 0.39; 'wed,': 0.39; 'similar': 0.65; 'now,': 0.67;
'subject: \n ': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=mHtPqr4M5PLWcQ4U/OrwIZJql32b67pwUxcIyAxBNSs=;
b=dVp1f9JHvx1k2VtJuvfxHLSxX4lcrgUxGQq9I2gpA5r0cM/jdJTE/y+1iRVaAwxbPP
+icM//pJLq33RIA8aLXduMHkJjmhBh177E+Nfa/d2mnOMnYrEtdhshZRIUTSLNgpZKqx
2rQYJEYkoRbzegXgPz/rnhVAImR6H2zieXxmq8N8UTXxmBTLwcJIu/JCwejNfpxjFg+x
EG78vOgfs4E7wlr29dggMJNzaZW4BuwtIdkVjlouYiWNAfX2/UhINq5lE28kE+HyGn6p
kgwkOXyZ6MPnQVHd8TTJ8shLMbxFX4t4MiWnM91soSGbeGl66FT7krWVhrZwulXGd4OD
5sVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
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=mHtPqr4M5PLWcQ4U/OrwIZJql32b67pwUxcIyAxBNSs=;
b=aAV3KuaT+Bb1b/P3lVfM3Zd/wkQC1HFQWJ19BZnWV0/tKgOHNsOJukPvKX9uzn6U2O
sap2DGhi61BnozcLeaiYtAiSuLGdhe/0VffNrNQ7rBWwhk09GwN7/gjxATgurC84MCR4
G5lfR1vrQ22P/DAKBC0WkrWen+5tmZhAHZkwNOnhoIGHPX+635uyH/wpu4pUQ24r5JYV
NoLCSAV3X866eZ2ldajnEUOt8Wk1smKZopPslxEwdzLKmjHOFo7FhF1rsRNXgEN+URZg
Tgs6K3YOKeEYvPCMNqFrYSKuhktNPKuhnSoq6y0mNI3pp8eBKFbqSClURKZZeWV2bBwj
hogw==
X-Gm-Message-State: AFqh2krWBCERy1p7VMddg/UuRf6K8YgoqWOEzGtACRYUoMB3+4Xj/fbK
98qf5KlSt++Mzl4CPZiL/pHnAxaXpWAZ9QKNulYcZnpu
X-Google-Smtp-Source: AMrXdXusub9DbDasw5R91Ubi4ebfeYYjumy8xUfZ1Zgn8b9NAd6RUH7lNoiuVlMk6B3c2DJn5mx/EFgjuiLPB6mT94w=
X-Received: by 2002:a17:906:1ec1:b0:7c1:b65:ad79 with SMTP id
m1-20020a1709061ec100b007c10b65ad79mr11578ejj.402.1671598896638; Tue, 20 Dec
2022 21:01:36 -0800 (PST)
In-Reply-To: <e5b9a0c4-143e-411f-a779-58c30a32ca99n@googlegroups.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: <CAPTjJmr2ecsGH=eNR+PTDOZg5LSu-JyteGVqi+RqVgKHSJBk+g@mail.gmail.com>
X-Mailman-Original-References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org>
<c2d88e02-718e-330b-a752-57b4e257be58@tompassin.net>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
<mailman.1278.1671507379.20444.python-list@python.org>
<e5b9a0c4-143e-411f-a779-58c30a32ca99n@googlegroups.com>
 by: Chris Angelico - Wed, 21 Dec 2022 05:01 UTC

On Wed, 21 Dec 2022 at 15:28, Jach Feng <jfong@ms4.hinet.net> 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.

ChrisA

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

<9e965167-3e8c-418c-bafa-598d4e1de99cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:7114:0:b0:3a5:50fa:1a32 with SMTP id z20-20020ac87114000000b003a550fa1a32mr16036qto.11.1671601213639;
Tue, 20 Dec 2022 21:40:13 -0800 (PST)
X-Received: by 2002:a05:6870:5d9a:b0:144:4bf1:a6fd with SMTP id
fu26-20020a0568705d9a00b001444bf1a6fdmr29453oab.232.1671601213268; Tue, 20
Dec 2022 21:40:13 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 20 Dec 2022 21:40:13 -0800 (PST)
In-Reply-To: <mailman.1284.1671598898.20444.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=218.166.10.247; posting-account=G2sM6AoAAADOlDdo9rWD6sFkj3T5ULsz
NNTP-Posting-Host: 218.166.10.247
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org> <c2d88e02-718e-330b-a752-57b4e257be58@tompassin.net>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com> <mailman.1278.1671507379.20444.python-list@python.org>
<CAPTjJmr2ecsGH=eNR+PTDOZg5LSu-JyteGVqi+RqVgKHSJBk+g@mail.gmail.com>
<e5b9a0c4-143e-411f-a779-58c30a32ca99n@googlegroups.com> <mailman.1284.1671598898.20444.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9e965167-3e8c-418c-bafa-598d4e1de99cn@googlegroups.com>
Subject: Re: How to enter escape character in a positional string argument
from the command line?
From: jfong@ms4.hinet.net (Jach Feng)
Injection-Date: Wed, 21 Dec 2022 05:40:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2196
 by: Jach Feng - Wed, 21 Dec 2022 05:40 UTC

Chris Angelico 在 2022年12月21日 星期三下午1:02:01 [UTC+8] 的信中寫道:
> On Wed, 21 Dec 2022 at 15:28, Jach Feng <jf...@ms4.hinet.net> 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.
>
> ChrisA
Really? Where? I can't find it in my Windows 8.1

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: How to enter escape character in a positional string argument
from the command line?
Date: Thu, 22 Dec 2022 03:12:50 +1100
Lines: 20
Message-ID: <mailman.1288.1671639182.20444.python-list@python.org>
References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org>
<c2d88e02-718e-330b-a752-57b4e257be58@tompassin.net>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
<mailman.1278.1671507379.20444.python-list@python.org>
<CAPTjJmr2ecsGH=eNR+PTDOZg5LSu-JyteGVqi+RqVgKHSJBk+g@mail.gmail.com>
<e5b9a0c4-143e-411f-a779-58c30a32ca99n@googlegroups.com>
<mailman.1284.1671598898.20444.python-list@python.org>
<9e965167-3e8c-418c-bafa-598d4e1de99cn@googlegroups.com>
<CAPTjJmpzJjvuB3aMjOAP5UV1Uv+mBv_o2w5DWnP4b1O+fz4LSw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de lIplmMqIQ8Md5Y4BqkJ47QiVJN6ltimyKW57KZKLUiEQ==
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=HwPacjNJ;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.007
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '2022': 0.05; 'windows,':
0.05; '8.1': 0.09; 'angelico': 0.09; 'git': 0.09; 'ultimate':
0.09; 'bash': 0.16; 'chrisa': 0.16; 'fetch': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'instead.': 0.16; 'subject:string': 0.16; 'wrote:': 0.16; "can't":
0.17; 'thu,': 0.19; 'to:addr:python-list': 0.20; 'first,': 0.22;
'install': 0.23; 'subject:How': 0.23; 'available,': 0.26; 'chris':
0.28; 'dec': 0.31; 'message-id:@mail.gmail.com': 0.32; 'skip:2
10': 0.32; 'but': 0.32; 'path': 0.33; 'windows': 0.34; "didn't":
0.34; 'mean': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'people': 0.36; 'subject:from': 0.37; "it's": 0.37;
'received:209.85': 0.37; 'received:209': 0.39;
'received:209.85.208': 0.39; 'use': 0.39; 'wed,': 0.39; 'try':
0.40; 'search': 0.61; "you'd": 0.64; 'similar': 0.65; 'now,':
0.67; '8bit%:100': 0.76; 'quick': 0.77; 'subject: \n ': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=content-transfer-encoding:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=nTtRSlxNJ3BWzPF5cZsU9fJMtpIoR9R3tz4TYHY9gZk=;
b=HwPacjNJ7ywhfofzZIZCX3ZoUDsItRrYLXB0cwBd25YnYQLYBbeaM6gyUujsrrJ5gX
ISGvaFQwJfAnP3fVgeN+G18EebH3Ki+csTsxYvMqVKEL+BHMCobAynf0iY3ID9wm8MUl
L/2VLPqdxfaX2Jm5iajpIht+ouZMjGq7Un8OeKbJjiIMou+mJm7dRAG7sRR9IKLIHC5j
Zsr8ytw0fUXEC2O7RhuYJN4H9IoRuHX8uYZJbLrzNEmp1VG09rGNndS4s+bY1XfKJVdZ
RPCD6FafDe6cYevsIMJcn0tNj9FJOrNUqVtPXGIk5zB+KSG585BPbE90KfaEkOiTDo4V
znKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=content-transfer-encoding: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=nTtRSlxNJ3BWzPF5cZsU9fJMtpIoR9R3tz4TYHY9gZk=;
b=EDYEPl1Jviduneebu+RbV1rY3mAg/NNcABq+MIyatklV2w4tGYFjW2dp/SFhveGwDU
CSy70SQoqThmVEXWtZ2qF8vpIJRUXKH7PLHOpLep70JxCjTTLh33xJTJcR+CkYUO53if
l8Y/4XsuE7kSKeGRQrefZNOo8UHwrQAZDAi2VJVPSNd/qF9IKxFe5R+BaPZmre2R26ph
/MYMEZDg1/ngFKQmfmGm+GjBomM463EFJIAVispwswR31zXOZ2wrU5Q42YNG0RN2XGKy
Pyzk12fqZIPLI853zM57xfWnU2ZIWfpdNa8417Y29/ryV2g6ENZueN0LwDgQDC5oe3tL
x2hQ==
X-Gm-Message-State: AFqh2kqpBzt1KHhw6VNbAjXtiMMgICBE6YKEpW+v1DdlNwx7dPFW3nd3
+qUrbvEPQzaAJWmOFW7C52bibFiIvevKKwh7nqgIhG3D
X-Google-Smtp-Source: AMrXdXtdEGdfMjVB/LM5Ovs8mfqIKzlwQ1JXWa0I0Uidw6vjWkvVI+aipdrDtvKCJW/P9p/GhfMqL+/e+QJbZdzEvRM=
X-Received: by 2002:aa7:c151:0:b0:46b:fb4:6b6f with SMTP id
r17-20020aa7c151000000b0046b0fb46b6fmr166308edp.237.1671639181257; Wed, 21
Dec 2022 08:13:01 -0800 (PST)
In-Reply-To: <9e965167-3e8c-418c-bafa-598d4e1de99cn@googlegroups.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: <CAPTjJmpzJjvuB3aMjOAP5UV1Uv+mBv_o2w5DWnP4b1O+fz4LSw@mail.gmail.com>
X-Mailman-Original-References: <6b7f0c6d-f745-4745-aa5f-2012ec8ed906n@googlegroups.com>
<tnqinh$l03$1@gioia.aioe.org>
<c2d88e02-718e-330b-a752-57b4e257be58@tompassin.net>
<c108a398-fd82-44fc-ae82-f4464faccf9dn@googlegroups.com>
<mailman.1278.1671507379.20444.python-list@python.org>
<CAPTjJmr2ecsGH=eNR+PTDOZg5LSu-JyteGVqi+RqVgKHSJBk+g@mail.gmail.com>
<e5b9a0c4-143e-411f-a779-58c30a32ca99n@googlegroups.com>
<mailman.1284.1671598898.20444.python-list@python.org>
<9e965167-3e8c-418c-bafa-598d4e1de99cn@googlegroups.com>
 by: Chris Angelico - Wed, 21 Dec 2022 16:12 UTC

On Thu, 22 Dec 2022 at 03:11, Jach Feng <jfong@ms4.hinet.net> wrote:
>
> Chris Angelico 在 2022年12月21日 星期三下午1:02:01 [UTC+8] 的信中寫道:
> > On Wed, 21 Dec 2022 at 15:28, Jach Feng <jf...@ms4.hinet.net> 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.
> >
> > ChrisA
> Really? Where? I can't find it in my Windows 8.1

Ah, I didn't mean "ships with"; bash for Windows is very much
available, but you'd have to go fetch it. Try the Windows app store
first, and if not, a quick web search will find it. Or install Git for
Windows, which comes with bash.

ChrisA


devel / comp.lang.python / Re: How to enter escape character in a positional string argument from the command line?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor