Skip to main content
  • 3,387 Posts
  • 13,851 Replies
3387 Posts
how to pass a list from python

Hi FME'ers when creating a list with the following Python script:import fme, osimport fmeobjectsfolder = os.path.dirname(FME_MacroValues['Folder'])def get_filepaths(feature):    """    This function will generate the file names in a directory     tree by walking the tree either top-down or bottom-up. For each     directory in the tree rooted at directory top (including top itself),     it yields a 3-tuple (dirpath, dirnames, filenames).    """file_paths = []  # List which will store all of the full filepaths.    # Walk the tree.for root, directories, files in os.walk(folder):        for filename in files:            # Join the two strings in order to form the full filepath. if '.dwg' in filename and '_georeferenced.dwg' not in filename:                  filepath = os.path.join(root, filename)                file_paths.append(filepath)  # Add it to the list.feature.setAtt

Badge Winners

Show all badges

Community Stats

32,404
Posts
123,151
Replies
40,506
Members