Message394135
An issue I encountered recently with argparse was when I tried running a script with its argument changed from something like:
```
parser.add_argument('--please_work')
```
and was replaced with:
```
parser.add_argument('--please-work')
```
I have not ever seen anyone add an argument where a function has two arguments existing in a function, such as please_work and please-work. I think this is a pretty safe feature to implement, plus it enforces good practices. So if I wrote something such as:
```
parser = argparse.ArgumentParser(description="check this out")
parser.add_argument('--please-work')
```
Then I could call the program using:
```
python3 test.py --please_work True
```
or:
```
python3 test.py --please-work True
``` |
|
Date |
User |
Action |
Args |
2021-05-21 17:51:20 | wbarnha | set | recipients:
+ wbarnha |
2021-05-21 17:51:20 | wbarnha | set | messageid: <1621619480.47.0.120101426559.issue44208@roundup.psfhosted.org> |
2021-05-21 17:51:20 | wbarnha | link | issue44208 messages |
2021-05-21 17:51:20 | wbarnha | create | |
|