How to use command line argument in python to write a program implement linux command 'find'?
### we can use argument parser in python for Commnad line Argument
For Example :
-------------
import argparse my_parser = argparse.ArgumentParser(fromfile_prefix_chars='@') my_parser.add_argument('a', help='a first argument') my_parser.add_argument('b', help='a second argument') my_parser.add_argument('c', help='a third argument') my_parser.add_argument('d', help='a fourth argument') my_parser.add_argument('e', help='a fifth argument') my_parser.add_argument('-v', '--verbose', action='store_true', help='an optional argument') # Execute parse_args() args = my_parser.parse_args() print('If you read this line it means that you have provided ' 'all the parameters')
Get Answers For Free
Most questions answered within 1 hours.