Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Cameron Simpson
On 29Jan2023 08:10, avi.e.gr...@gmail.com wrote: You are technically correct but perhaps off the mark. Yes, a python program only sees what is handed to it by some shell if invoked a certain way. The issue here is what you tell people using your program about what they need to type to get

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Cameron Simpson
On 29Jan2023 07:12, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: On 2023-01-29 at 16:51:20 +1100, Cameron Simpson wrote: They're unrelated. As others have mentioned, "--" is _extremely_ common; almost _all_ UNIX command like programmes which handle -* style

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Ethan Furman
This thread has run its course and seems to now be generating more heat than light. It is now closed (at least on the Python List side). Thank you everyone for your participation and understanding. -- ~Ethan~ Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Mark Bourne
Jach Feng wrote: Thank you for detail explanation of the role the shell is involved in this problem. I'm very appreciated! It seems that a CLI app may become very complex when dealing with different kind of shell, and may not be possible to solve its problem. But the good thing in my app is

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Mark Bourne
Jach Feng wrote: Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL,

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > > Also fail in REPL, > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Peter J. Holzer
On 2023-01-27 21:03:39 -0800, Jach Feng wrote: > I have to admit that I don't know the background upon which the > argparse was built. The good side is that I don't carry its historical > knowledge ( or burden?), that's why I can use it in a new way I don't see what's new about that. > which may

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Peter J. Holzer
On 2023-01-29 07:59:21 -0500, avi.e.gr...@gmail.com wrote: > Although today you could say POSIX is the reason for many things including > the use of "--" I hesitate to mention I and many others used that convention > long before as a standard part of many UNIX utilities. I somewhat doubt that you

RE: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread avi.e.gross
of "--" ... -Original Message- From: Python-list On Behalf Of Cameron Simpson Sent: Sunday, January 29, 2023 12:51 AM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? On 28Jan2023 18:55, Jach Feng wrote: >Mark Bour

RE: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread avi.e.gross
tandardize, ... -Original Message- From: Python-list On Behalf Of 2qdxy4rzwzuui...@potatochowder.com Sent: Sunday, January 29, 2023 7:12 AM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? On 2023-01-29 at 16:51:20 +1100, Ca

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread 2QdxY4RzWzUUiLuE
On 2023-01-29 at 16:51:20 +1100, Cameron Simpson wrote: > They're unrelated. As others have mentioned, "--" is _extremely_ common; > almost _all_ UNIX command like programmes which handle -* style options > honour the "--" convention. _argparse_ itself honours that convention, as > does getopt

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Cameron Simpson
On 28Jan2023 18:55, Jach Feng wrote: Mark Bourne 在 2023年1月28日 星期六晚上10:00:01 [UTC+8] 的信中寫道: I notice you explain the need to enclose the equation in quotes if it contains spaces. That's not even a feature of your application, but of the shell used to call it. So why so much objection to

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Chris Angelico
On Sun, 29 Jan 2023 at 14:29, Jach Feng wrote: > Thank you for detail explanation of the role the shell is involved in this > problem. I'm very appreciated! > > It seems that a CLI app may become very complex when dealing with different > kind of shell, and may not be possible to solve its

RE: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread avi.e.gross
to do what you want. -Original Message- From: Python-list On Behalf Of Jach Feng Sent: Saturday, January 28, 2023 12:04 AM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8]

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Jach Feng
Mark Bourne 在 2023年1月28日 星期六晚上10:00:01 [UTC+8] 的信中寫道: > Jach Feng wrote: > > Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > >> Fail on command line, > >> > >> e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > >> usage: infix2postfix.py [-h] [infix] > >> infix2postfix.py:

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > > Also fail in REPL, > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Mark Bourne
Jach Feng wrote: Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL,

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-27 Thread Michael Torrie
On 1/25/23 19:50, Jach Feng wrote: > To me, argparse has been just a tool which I can use in a CLI app. argparse is just a tool for dealing with command-line *flags*, which are common in command-line tools. argparse interprets the command line as a bunch of flags because that's what it's

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-26 Thread Mats Wichmann
On 1/24/23 23:28, Jach Feng wrote: Chris Angelico 在 2023年1月25日 星期三下午1:16:25 [UTC+8] 的信中寫道: On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: I was happy working with argparse during implement my script. To save the typing, I used a default equation for testing. sample = "-4^2+5.3*abs(-2-1)/2,

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Chris Angelico
On Thu, 26 Jan 2023 at 14:13, Jach Feng wrote: > Now I understand some oppose this idea and saying that you shouldn't use a > kitchen knife to cut a cake:-) You shouldn't use a chainsaw to cut a cake, and then ask us why cake-cutting is so noisy. ChrisA --

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > > Also fail in REPL, > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread David
On Thu, 26 Jan 2023 at 04:24, Jach Feng wrote: > Chris Angelico 在 2023年1月25日 星期三下午1:16:25 [UTC+8] 的信中寫道: > > On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: > > You're still not really using argparse as an argument parser. Why not > > just do your own -h checking? Stop trying to use argparse for

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Weatherby,Gerard
the number of arguments and the like. From: Python-list on behalf of Jach Feng Date: Wednesday, January 25, 2023 at 12:25 PM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? *** Attention: This is an external email. Use caution

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Chris Angelico
On Thu, 26 Jan 2023 at 04:25, Jach Feng wrote: > > Chris Angelico 在 2023年1月25日 星期三下午1:16:25 [UTC+8] 的信中寫道: > > On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: > > > I was happy working with argparse during implement my script. To save the > > > typing, I used a default equation for testing. > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-25 Thread Jach Feng
Chris Angelico 在 2023年1月25日 星期三下午1:16:25 [UTC+8] 的信中寫道: > On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: > > I was happy working with argparse during implement my script. To save the > > typing, I used a default equation for testing. > > > > sample = "-4^2+5.3*abs(-2-1)/2, abs(Abc)*(B+C)/D,

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Cameron Simpson
On 25Jan2023 16:15, Chris Angelico wrote: On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: I was happy working with argparse during implement my script. To save the typing, I used a default equation for testing. Sure, but what benefit was it bringing you? Just the usage (help) message? Did

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Chris Angelico
On Wed, 25 Jan 2023 at 14:42, Jach Feng wrote: > I was happy working with argparse during implement my script. To save the > typing, I used a default equation for testing. > > sample = "-4^2+5.3*abs(-2-1)/2, abs(Abc)*(B+C)/D, (-3) * > sqrt(1-(x1/7)*(y1/7)) * sqrt(abs((x0-4.5)/(y0-4)))" > parser

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > > Also fail in REPL, > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Jach Feng
g the issue. > -Original Message- > From: Python-list On > Behalf Of Jach Feng > Sent: Tuesday, January 24, 2023 2:21 AM > To: pytho...@python.org > Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string > argument? > cameron...@gmai

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Jach Feng
Michael Torrie 在 2023年1月25日 星期三凌晨3:05:44 [UTC+8] 的信中寫道: > On 1/23/23 18:58, Jach Feng wrote: > > More pathonic, but don't work. The '--' must be at index 1:-) > I'm very confused. Why are you even using argparse, since if you put -- > at index 1 then argparse wont't do any argument parsing at

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Dennis Lee Bieber
On Tue, 24 Jan 2023 15:13:33 + (UTC), Mike Baskin declaimed the following: >Can you stop please > Stop what? You appear to be subscribed to the Python mailing list -- as such you WILL receive all traffic that appears on that list. There is nothing we can do. It is not a

RE: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread avi.e.gross
pression are evaluated or changed before python is even invoked. Then again, I may be misunderstanding the issue. -Original Message- From: Python-list On Behalf Of Jach Feng Sent: Tuesday, January 24, 2023 2:21 AM To: python-list@python.org Subject: Re: How to make argparse accep

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Mike Baskin via Python-list
Can you stop please Sent from Yahoo Mail for iPhone On Tuesday, January 24, 2023, 10:12 AM, Thomas Passin wrote: On 1/23/2023 9:12 PM, Chris Angelico wrote: > On Tue, 24 Jan 2023 at 13:09, Jach Feng wrote: >> >> Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道: >>> On Tue, 24 Jan

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Mike Baskin via Python-list
Stop please Sent from Yahoo Mail for iPhone On Tuesday, January 24, 2023, 1:05 AM, Cameron Simpson wrote: On 23Jan2023 17:58, Jach Feng wrote: parser.parse_args(['--', 'infix2postfix.py', '-4.3+5']) >usage: [-h] infix >: error: unrecognized arguments: -4.3+5 This error doesn't look

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Jach Feng
cameron...@gmail.com 在 2023年1月24日 星期二下午2:05:33 [UTC+8] 的信中寫道: > On 23Jan2023 17:58, Jach Feng wrote: > parser.parse_args(['--', 'infix2postfix.py', '-4.3+5']) > >usage: [-h] infix > >: error: unrecognized arguments: -4.3+5 > This error doesn't look like "-4.3+5 looks like an option" but

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Michael Torrie
On 1/23/23 18:58, Jach Feng wrote: > More pathonic, but don't work. The '--' must be at index 1:-) I'm very confused. Why are you even using argparse, since if you put -- at index 1 then argparse wont't do any argument parsing at all. If all you want is the expression on the command line, just

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? WRONG TOOL

2023-01-24 Thread Weatherby,Gerard
thread is a massive "how can I use X to do Y?" problem. From: Python-list on behalf of Thomas Passin Date: Tuesday, January 24, 2023 at 10:23 AM To: Mike Baskin , python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string arg

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Thomas Passin
On 1/24/2023 10:13 AM, Mike Baskin wrote: Can you stop please It's way past time, isn't it! Sent from Yahoo Mail for iPhone On Tuesday, January 24, 2023, 10:12 AM, Thomas Passin wrote: On 1/23/2023 9:12 PM, Chris Angelico wrote: > On

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-24 Thread Thomas Passin
On 1/23/2023 9:12 PM, Chris Angelico wrote: On Tue, 24 Jan 2023 at 13:09, Jach Feng wrote: Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道: On Tue, 24 Jan 2023 at 07:47, Cameron Simpson wrote: But for Jach Feng: the "--" is really expected as something the user does when they

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Cameron Simpson
On 23Jan2023 17:58, Jach Feng wrote: parser.parse_args(['--', 'infix2postfix.py', '-4.3+5']) usage: [-h] infix : error: unrecognized arguments: -4.3+5 This error doesn't look like "-4.3+5 looks like an option" but instead "we don't expect any arguments after "infix". Not personally a fan

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Jach Feng
Greg Ewing 在 2023年1月24日 星期二清晨7:33:43 [UTC+8] 的信中寫道: > >> On 2023-01-22 at 18:19:13 -0800, > >> Jach Feng wrote: > >>> 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. > >>> sys.argv.insert(1, '--') > >>> args = parser.parse_args() > If you do that, you'll never be able

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Chris Angelico
On Tue, 24 Jan 2023 at 13:09, Jach Feng wrote: > > Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道: > > On Tue, 24 Jan 2023 at 07:47, Cameron Simpson wrote: > > > > > > But for Jach Feng: the "--" is really expected as something the user > > > does when they invoke your programme,

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Jach Feng
Chris Angelico 在 2023年1月24日 星期二清晨5:00:27 [UTC+8] 的信中寫道: > On Tue, 24 Jan 2023 at 07:47, Cameron Simpson wrote: > > > > But for Jach Feng: the "--" is really expected as something the user > > does when they invoke your programme, _explicitly_ saying that what > > follows from here is not an

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Jach Feng
2qdxy4rz...@potatochowder.com 在 2023年1月24日 星期二凌晨2:47:12 [UTC+8] 的信中寫道: > On 2023-01-22 at 18:19:13 -0800, > Jach Feng wrote: > > > 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. > > sys.argv.insert(1, '--') > > args = parser.parse_args() > Please don't do that. :-) >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Greg Ewing
On 2023-01-22 at 18:19:13 -0800, Jach Feng wrote: 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. sys.argv.insert(1, '--') args = parser.parse_args() If you do that, you'll never be able to have any actual options, so using argparse seems like overkill. Just pull the

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Chris Angelico
On Tue, 24 Jan 2023 at 07:47, Cameron Simpson wrote: > > But for Jach Feng: the "--" is really expected as something the user > does when they invoke your programme, _explicitly_ saying that what > follows from here is not an argument. So the user is expected to type: > > your_script -x -y

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Cameron Simpson
On 23Jan2023 13:46, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: On 2023-01-22 at 18:19:13 -0800, Jach Feng wrote: 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. sys.argv.insert(1, '--') args = parser.parse_args() Please don't do

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread 2QdxY4RzWzUUiLuE
On 2023-01-22 at 18:19:13 -0800, Jach Feng wrote: > 1) Modify the sys.argv by inserting an item '--' before parsing it, ie. > sys.argv.insert(1, '--') > args = parser.parse_args() Please don't do that. :-) In my mind, sys.argv belongs to Python, not the application. Instead, pass a newly

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Jach Feng
Jach Feng 在 2023年1月22日 星期日上午11:11:22 [UTC+8] 的信中寫道: > Fail on command line, > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > usage: infix2postfix.py [-h] [infix] > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 > > Also fail in REPL, > >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-23 Thread Grant Edwards
On 2023-01-22, Weatherby,Gerard wrote: > Argparse is for parsing command line arguments and options. > > If you just want to evaluate an Python expression, use eval( ) Only use eval() if the expression is always under your control (and you don't make mistakes when typing). Don't use eval() on

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Michael Torrie
On 1/22/23 11:44, Stefan Ram wrote: > Jach Feng writes: >> e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > > Well, it's a nice exercise! But I only made it work for the > specific example given. I have not tested whether it always > works. Haha. Yes a nice exercise, but has

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Cameron Simpson
On 21Jan2023 19:11, Jach Feng wrote: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 The usual convention for having "nonoption" arguments beginning

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Weatherby,Gerard
:24 AM To: python-list@python.org Subject: Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument? *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** Thomas Passin 在 2023年1月22日 星期日下午1:30:39 [UTC+8] 的信中寫道: >

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Thomas Passin
On 1/22/2023 10:45 AM, Peter J. Holzer wrote: Notice that this file is in its first release, version 0.0.1 - the metadata that says it's 'Development Status :: 5 - Production/Stable' seems to be bogus. So it may very well be buggy. It is at least too incomplete to be useful. It handles only

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Mark Bourne
Jach Feng wrote: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL, e:\Works\Python>py Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021,

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Jach Feng
Thomas Passin 在 2023年1月22日 星期日下午1:30:39 [UTC+8] 的信中寫道: > On 1/21/2023 10:11 PM, Jach Feng wrote: > > Fail on command line, > > > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > > usage: infix2postfix.py [-h] [infix] > > infix2postfix.py: error: unrecognized arguments:

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Peter J. Holzer
On 2023-01-22 00:30:07 -0500, Thomas Passin wrote: > On 1/21/2023 10:11 PM, Jach Feng wrote: > > e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" > > usage: infix2postfix.py [-h] [infix] > > infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 [...] > > > > > import

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-21 Thread Thomas Passin
On 1/21/2023 10:11 PM, Jach Feng wrote: Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL, e:\Works\Python>py Python 3.8.8

How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-21 Thread Jach Feng
Fail on command line, e:\Works\Python>py infix2postfix.py "-4^2+5.3*abs(-2-1)/2" usage: infix2postfix.py [-h] [infix] infix2postfix.py: error: unrecognized arguments: -4^2+5.3*abs(-2-1)/2 Also fail in REPL, e:\Works\Python>py Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:08:11) [MSC v.1928