mirror of
https://github.com/open-mmlab/mmcv.git
synced 2025-06-03 21:54:52 +08:00
* Add test util for checking stand-alone scripts Signed-off-by: lizz <lizz@sensetime.com> * Restrict to python scripts Signed-off-by: lizz <lizz@sensetime.com> * fix Signed-off-by: lizz <lizz@sensetime.com> * tiny Signed-off-by: lizz <lizz@sensetime.com> * Allow no capture Signed-off-by: lizz <lizz@sensetime.com> * Simplify interface Signed-off-by: lizz <lizz@sensetime.com> * Technical notes Signed-off-by: lizz <lizz@sensetime.com> * tiny Signed-off-by: lizz <lizz@sensetime.com> * Update hello.py * Update test_testing.py * Update test_testing.py
25 lines
418 B
Python
Executable File
25 lines
418 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import argparse
|
|
import warnings
|
|
|
|
|
|
def parse_args():
|
|
parser = argparse.ArgumentParser(description='Say hello.')
|
|
parser.add_argument('name', help='To whom.')
|
|
|
|
args = parser.parse_args()
|
|
|
|
return args
|
|
|
|
|
|
def main():
|
|
args = parse_args()
|
|
print(f'hello {args.name}!')
|
|
if args.name == 'agent':
|
|
warnings.warn('I have a secret!')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|