差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| python:argparse [2020/02/02 10:08] – ともやん | python:argparse [2020/09/11 16:30] (現在) – ともやん | ||
|---|---|---|---|
| 行 2: | 行 2: | ||
| ===== サンプル ===== | ===== サンプル ===== | ||
| + | <WRAP prewrap 100% # | ||
| <code python args_sample.py> | <code python args_sample.py> | ||
| # | # | ||
| 行 24: | 行 25: | ||
| main() | main() | ||
| </ | </ | ||
| + | </ | ||
| ===== 実行例 ===== | ===== 実行例 ===== | ||
| - | < | + | <WRAP prewrap 100%> |
| + | < | ||
| $ python args_sample.py | $ python args_sample.py | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| usage: args_sample.py [-h] [--exclude EXCLUDE [EXCLUDE ...]] target_dir | usage: args_sample.py [-h] [--exclude EXCLUDE [EXCLUDE ...]] target_dir | ||
| args_sample.py: | args_sample.py: | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| $ python args_sample.py -h | $ python args_sample.py -h | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| usage: args_sample.py [-h] [--exclude EXCLUDE [EXCLUDE ...]] target_dir | usage: args_sample.py [-h] [--exclude EXCLUDE [EXCLUDE ...]] target_dir | ||
| 行 41: | 行 56: | ||
| --exclude EXCLUDE [EXCLUDE ...] | --exclude EXCLUDE [EXCLUDE ...] | ||
| exclude directory or file. | exclude directory or file. | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| $ python args_sample.py / --exclude .git | $ python args_sample.py / --exclude .git | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| target_dir: / | target_dir: / | ||
| exclude_dirs: | exclude_dirs: | ||
| - | |||
| </ | </ | ||
| + | </ | ||
| ===== 参考文献 ===== | ===== 参考文献 ===== | ||