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 access it directly.
 If it's spread out with spaces, you can do something like this to put
it back together:

expression = " ".join(sys.argv[1:]

Otherwise the standard unix way of doing this is to require the user to
either provide the -- himself, or put the expression in quotes so it's
one unit.



-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to