0

I am beginner in python , I need a help please:

First i try to pass the path of a dataset in parameter.

I like to know how I can browse the dataset from this path.

this My code

import argparse

if __name__ == '__main__':
    # Initialize the parser
    parser = argparse.ArgumentParser(
    description="my math script"**strong text**

    )

    # Add the parameters positional/optional
    parser.add_argument('-input','--d', help="path to input database mat file", type=str)



    # Parse the arguments
    args = parser.parse_args()
    print(args)
  • What do you mean by "browse"? Following `yourscript.py -d /path/to/database`, the value of `args.d` will be `/path/to/database`. Use `args.d` as you would any other variable. – chepner Jul 29 '19 at 16:29
  • Welcome! It's unclear what you're asking. Do you want to open a file? Or are you having trouble getting the path from args? – Chris Charles Jul 29 '19 at 16:29
  • Do you want to browse a directory for its content? This question has been already answered: https://stackoverflow.com/questions/5817209/browse-files-and-subfolders-in-python – Andrew Jul 29 '19 at 16:30
  • no already i get the path, now i need to do a for boucle to process all the image in the path entered – amri rahma Jul 29 '19 at 16:35

0 Answers0