On Wed, 25 Jan 2023 at 14:42, Jach Feng <jf...@ms4.hinet.net> 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 = argparse.ArgumentParser(description='Convert infix notation to > postfix') > parser.add_argument('infix', nargs='?', default=sample, help="....") >
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 what it's not designed for, and then wondering why it isn't doing what you expect it to magically know. ChrisA -- https://mail.python.org/mailman/listinfo/python-list