Greg Ewing 在 2023年1月24日 星期二清晨7:33:43 [UTC+8] 的信中寫道:
> >> On 2023-01-22 at 18:19:13 -0800, 
> >> Jach Feng <jf...@ms4.hinet.net> 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 argument out of 
> argv directly. 
> 
> -- 
> Greg
Any easy way to "pull the argument out of argv directly" before parse_args()?:-)
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to