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

Cameron Simpson cs at cskk.id.au
Sun Jan 29 16:20:21 EST 2023


On 29Jan2023 08:10, avi.e.gross at gmail.com <avi.e.gross at 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 it to work. That means if their shell is going to make changes in what they typed, they need to know how to avoid unintended changes. As one example not mentioned, whitespace disappears if not somehow protected as in quotes.

Hmm, there is that. But the OP needs clarity on what happens in a shell 
and what happens in a programme once the shell has invoked it for a 
user.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list