pymel.core.system.getFileList

getFileList(*args, **kwargs)

Returns a list of files matching an optional wildcard pattern. Note that this command works directly on raw system files and does not go through standard Maya file path resolution.

Flags:

Long Name / Short Name Argument Types Properties
filespec / fs unicode ../../../_images/create.gif
  wildcard specifier for search.
folder / fld unicode ../../../_images/create.gif
  return a directory listing Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.getFileList

Example:

import pymel.core as pm

# List the contents of the user's projects directory
#
pm.getFileList( folder=pm.internalVar(userWorkspaceDir=True) )
# Result: [u'default', u'mydir'] #

# List all MEL files in the user's script directory
#
pm.getFileList( folder=pm.internalVar(userScriptDir=True), filespec='*.mel' )
# Result: [] #